Skip to main content

Posts

Showing posts from 2018

Core Javascript coding test

// call , apply, bind //1. How to use bind() feature in javascript with example let button = function(content) { this.content = content; }; button.prototype.click = function() { console.log(`${this.content} clicked `); }; let newbtn = new button('add'); let boundclick = newbtn.click.bind(newbtn); boundclick(); //2. bind() using async funs let myobj = { asyncGet(cb) { cb(); }, parse() { console.log('parse called'); }, render() { this.asyncGet(function() { this.parse(); }.bind(this)) } }; myobj.render(); // ----------------------------JS Coding Test------------------------------------ //1. What does the following statement declares? var myArray = [ [ [] ] ]; // A. 3 dimension array //2.Question: What value is returned from the above statement? var test = "i'm a lasagna hog".split("").reverse().join(""); //Answer: "goh angasal a m'i" //3. What is returned ? ...

Frontend developer Interview questions

1. Can you describe your workflow when you create a web page? 2. Name 3 ways to decrease page load. (perceived or actual load time) 3. Explain few Common Security Issues with Ajax. or limitations of Using Ajax on a Web Page? A. security, SEO search engine indexing, user experience, accessibility issues, browser integration, response time concerns, SEO 4. What is the difference between .call() and .apply()?  .call() is used when the number of the function’s arguments are known to the programmer  .apply() is used when the number is not known 5. Explain the purpose of each of the HTTP request types when used with a RESTful web service.   -- GET, POST, PUT, PATCH, DELETE, TRACE, OPTIONS, HEAD, Connect.     HEAD, GET, OPTIONS and TRACE) are defined as safe methods 6. Explain the difference between stateless and stateful protocols. Which type of protocol is HTTP? Explain your answer. -- A stateless communications protocol treats each request a...

How to use Fancy Ext.Logger?

How to customize Ext.Logger effectively? For development, We can customize Ext.Logger mechanism and add colors to text as below /** * Fancy Ext.Logger.warn(), error() * By including this file we'll force override of the Ext.Logger.warn() behavior. eg: Ext.Logger.error(errMsg); Ext.Logger.warn('Warning msg'); */ Ext.define('Master.util.Log', { singleton: true, /** * Logs color-coded console message; intended for development only * to be used in betwee debug directives. * @param {String} text to log */ warn: function(text) { console.log('%cWARN: %s', 'background: #222; color: orange', text); }, error: function(text) { console.log('%cERROR: %s', 'background: #d9e6ee; color: red', text); } }, function() { Ext.Logger.warn = Master.util.Log.warn; Ext.Logger.error = Master.util.Log.error; });

EXTJS4 Override AJAX Timeouts

EXTJS4: Set global default Ajax timeout for sencha application Version Info: Ext JS 4.2x If we want to increase the timeout globally across my application. ExtJS documentation makes it look like setting Ext.Ajax.timeout will increase all timeouts, it’s just not true. This code sets 5 mins for forms, stores and ajax proxies calls within MVC application. Code snippet: Ext.Ajax.timeout= 300000; // 300 seconds (5 mins) Ext.override(Ext.form.Basic, { timeout: Ext.Ajax.timeout / 1000 }); Ext.override(Ext.data.proxy.Server, { timeout: Ext.Ajax.timeout }); Ext.override(Ext.data.Connection, { timeout: Ext.Ajax.timeout }); // If you are using Ext.define in your code. It creates new class and does not override timeout property in base class.Hence use above code snippet. Ext.define('Test.data.Connection', { override: 'Ext.data.Connection', timeout: 120000 });

ExtJS4 - 2016 Fiddles

ExtJS Fiddles (2016) // In exjts 4.1.x and 4.2.0, destroy() will not destroy its children components? Components without store binding  http://jsfiddle.net/mustafa0x/qVM82/1/ windows with stores http://jsfiddle.net/mustafa0x/qVM82/3/ EXT Speech Recognition Wrapper https://fiddle.sencha.com/#fiddle/3lu&view/editor Custom Editor for Property Grid http://jsfiddle.net/existdissolve/wMcQk/ Infinite scroll grid 4.2 https://fiddle.sencha.com/#view/editor&fiddle/e04 Cell editing - load store after layout event http://docs.sencha.com/extjs/4.2.4/extjs-build/examples/build/KitchenSink/ext-theme-neptune/#cell-editing Grid cellediting https://fiddle.sencha.com/#fiddle/100a&view/editor doComponent Layout- style with google fonts https://fiddle.sencha.com/#fiddle/eoj Fieldset - clear fields https://fiddle.sencha.com/#fiddle/1bdg Generating a Checkbox Group from a Store https://druckit.wordpress.com/2015/02/12/ext-js-generating-a-checkbox-group-fr...