Initially thought it was very simple, add an input checkbox in option. Did not work, online search some implementation methods, mainly using a div layer to simulate the dropdown. I would like to follow this idea, and then combined with the project specific application of their own to write a, found too troublesome. Just in another project to use ExtJS, found an extension Lovcombo, learned its own example (with the version of the 2.3 edition of the extjs,3.x version of the seemingly problematic). The key is to add it to the existing code and make as few changes as possible to the original code.
The process of handling more logic in the use of the Lado box is mainly focused on the configuration of the data source store and the processing of the Select event. The pattern of data and UI separation of the ExtJS itself makes cascading implementations very easy. Just update the store in the City dropdown box in the Select event in the Province dropdown box. A small area to note is that when an option is selected, an additional CheckField value is required to determine whether the option is checked or canceled. Also, select All, deselect all (these two lovcombo with methods SelectAll and Deselectall) and the number of selected options (need to traverse the store and detect the CheckField value of each item).
Copy Code code as follows:
Select Event for dropdown box
Select:function (combo, record, index)
{
Selected
if (Record.get (This.checkfield))
{
Processing logic When selected
}
Else
{
Not selected
}
}