Ans: Javascript is an awesome language. It’s super flexible.Browsers are the modern UI paradigm.
The javascript Libraries now must provide a rich set of UI Widgets.
javascript libraries:
Ans: The overall design of extjs is exemplary.One can learn a lot from it’s unified architecture – no matter which language one is programming in.
Extjs requires you to start with one of their base classes – ensuring a consitent model. Consistency is extremely important for the library to be reusable.
Ans:
Ans: You can use Ext JS with other common Web development server-side frameworks, including PHP, the Java™ language, Microsoft® .NET, Ruby on Rails, and ColdFusion.
Ans: Ext JS as a project to extend the functionality that the YUI Library.A key aspect of the YUI Library is the cross-browser support.The Extjs framework is fully object oriented and extensible. Because it's written in the JavaScript language.
Ans: A typical Ext JS Ajax implementation: an HTML text field and button element that posts data in the text field to a Web server when the button is clicked.
Ans: Ext can be used by Web Application developers who are familiar with HTML but may have little or no experience with JavaScript application development. If you are starting to build a new web application, or you are revamping an existing application, then take your time to understand the basics of the library including.
Ans: The Element API is fundamental to the entire Ext library.
Using traditional Javascript, selecting a DOM node by ID is done like this:
var myDiv = document.getElementById('myDiv');
Using Extjs:
Ext.onReady(function() {
var myDiv = Ext.get('myDiv');
});
Ans:
Ans: Ext.onReady(function() {
Ext.get('myButton').on('click', function(){
alert("You clicked the button");
});
});
ulating it.
Ans: Ext.onReady is probably the first method that you’ll use on every page. This method is automatically called once the DOM is fully loaded, guaranteeing that any page elements that you may want to reference will be available when the script runs
syntax:
Ext.onReady(function() {
alert(“Congratulations! You have Ext configured correctly!”);
});
Ans: Ext.onReady(function() {
Ext.select('p').on('click', function() {
alert("You clicked a paragraph");
});
});
or
Ext.onReady(function() {
var paragraphClicked = function() {
alert("You clicked a paragraph");
}
Ext.select('p').on('click', paragraphClicked);
});
Ans: ext-base.js
ext-all-debug.js or ext-all.js
ext-all.css
base.css or examples.css
Ans: xtheme-gray.css
ext-all.css
Ans: MessageBox is asynchronous.
MessageBox call, which demonstrates the readable message to user.
MessageBox used for multiple purpose like
Ext.Msg.alert()
Ext.Msg.prompt()
Ext.Msg.show({});
Ext.Msg.wait();
Ans: Ext.MessageBox.show({
title: 'Paragraph Clicked',
msg: 'User clicked on Paragraph',
width:400,
buttons: Ext.MessageBox.OK,
animEl: paragraph
});
Ans: updateText( [String text] ) : Ext.MessageBox
Ans: A widget is a tiny piece or component of functionality.
Ans: Ext.data.Store is parent class for all stores.
A Store object uses its configured implementation of DataProxy to access a data object unless you call loadData directly and pass in your data.
subclasses for Store:
GroupingStore, JsonStore, SimpleStore
Ans:
Ans: Using store.getCount() : Gets the number of cached records.
store.getTotalCount() : Gets the total number of records in the dataset as returned by the server.
Ans: Using loadexception event.
syntax: store.loadexception() : Fires if an exception occurs in the Proxy during loading.
use beforeload : ( Store this, Object options ) : Fires before a request is made for a new data object. If the beforeload handler returns false the load action will be canceled.
syntax:
store.on('loadexception', function(event, options, response, error) {
alert("Handling the error");
event.stopEvent();
});
Ans: Use store.commitChanges()
Ans: Calls the specified function for each of the Records in the cache
each( Function fn, [records Object] )
Ans: store.getModifiedRecords() : Gets all records modified since the last commit.
Ans: store.getAt( Number index ) : Get the Record at the specified index.
Ans: store.getById( String id ) : Get the Record with the specified id.
Ans: store.load() : returns boolean
Loads the Record cache from the configured Proxy using the configured Reader.
For remote data sources, loading is asynchronous, and this call will return before the new data has been loaded.
store.load({callback: fnCheckData, scope: this});
Ans: store.loadData( Object data, [Boolean append] ) : void
Loads data from a passed data block and fires the load event.
loadData(storeData,false); False to replace the existing records cache.
loadData(storeData,true) : True to append the new Records rather than replace the existing cache.
Ans: Layouts fall under this package Ext.layout.*
Types of layouts:
Ans: Using Ext.PagingToolbar plugin, we can implement pagination to a grid panel
syntax:
new Ext.PagingToolbar({
pageSize: 25,
store: store,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display",
})
// trigger the data store load
store.load({params:{start:0, limit:25}});
Ans: The xtype will be looked up at render time up to determine what type of child Component like TextField, NumberField etc to create. i,e
xtype = Class
----------------------
button = Ext.Button
textfield = Ext.form.TextField
radio - Ext.form.Radio
grid = Ext.grid.GridPanel
combo = Ext.form.Combobox
toolbar = Ext.Toolbar
store.getModifiedRecords(): returns array object
Ans: var record = grid.getStore().getAt(rowIndex);
Ans: To apply mask to page level / component level.
restrict user not to access any components in page
var pageProcessBox = new Ext.LoadMask( Ext.getBody(), { msg: 'Loading Employee details.' } );
pageProcessBox.show();
Ans: Using config option,
renderer: fnCellColor where fnCellColor is method to apply color to a cell.
Ans: using grid.getSelectionModel(); method
Ans: newRecord.endEdit();
Ans: newRecord.beginEdit();
Ans: newRecord.commit();
Q41. What is use of combo select event function?
Ans: To get the selected value from a combo.using getvalue();
var selectedComboValue = mycombo1.getValue();
Ans: using getvalue();
var selectedValue = mytextfield.getValue();
Ans: using config option as
emptyClass : 'emptycss', where emptycss is a css classname
Ans: store, columnmodel, id, width,height
Ans: using menuDisabled: true
Ans: using hidden : true
Ans: var grid = new Ext.grid.GridPanel({
store: new Ext.data.JsonStore({
[...]
listeners: {
load: this.onLoadSuccess.crateDelegate(this),
exception: this.onLoadException.createDelegate(this)
}
}),
onLoadSuccess: function () {
// success
},
onLoadException: function () {
// error
},
[...]
}
Ans: var json = Ext.decode(response.responseText);
Ext.Msg.alert('Error', json.error);
Ans: ExtJs and JQuery are kind of apples and oranges. You can compare Ext Core to JQuery, and ExtJs to JQuery UI.
Ext JS is a full-fledged widget library while jQuery (not jQuery UI) and Mootools are JavaScript frameworks that help with DOM manipulation etc.
Whilst jQuery and Mootools help with the general workings of a site.
jQuery UI is a much less rich set of components.
Ext JS seems to be focussed on tables and storing.
Related Interview Questions...