Combo

Combo Basic

This component is used to select one value among many values. Below is the explanation how to implement the combo

Combo_Basic_0

Way to create combo Data

InnerDataSet

We can represent data as list in combo using DataSet.

Combo_Basic_1

Way of using Component Editor

We can create data in combo without using DataSet, we can Component Editor to create data in Combo.

Combo_Basic_2

Generating data in combo by DataSet using innerDataSet, it makes flexible to change the development environment.

DataSet Binding

Combo can be represented by binding with DataSet.

Type

dropdown

Full item list will be display without searching

search

It shows text strings on List window by searching text strings close to input text string.

Filter

It shows items on List window by filtering according to input text strings.  
If there is no same text string, List window doesn't open.

Source Location

Sample\Combo\np_Combo_Basic.xfdl

Multi Combo

Creating Multi Combo using Popup Div

Combo_MultiCombo_0

Main Source Content

/*
 * File Name   : Combo_MultiCombo
 * Description : Creating Multi-Combo using Popup Div
 */
/*  Button Click  */
this.btn_execute_onclick = function(obj:Button,  e:nexacro.ClickEventInfo)
{    
 var nX = system.screenToClientX(this, system.clientToScreenX(obj,16)) - this.pdiv_input.width;
 var nY = system.screenToClientY(this, system.clientToScreenY(obj, 30));  
  
 this.pdiv_input.trackPopup(nX+12, nY); // Expending ComboBox
}
/*  Button Click  */
this.pdiv_input_grd_input_oncellclick = function(obj:Grid, e:nexacro.GridClickEventInfo)
{
 this.pdiv_input.closePopup();
 this.edt_output0.set_value(this.ds_data.getColumn(e.row, "COL0"));
 this.edt_output1.set_value(this.ds_data.getColumn(e.row, "COL1"));
}

Source Location

Sample\Combo\np_Combo_MultiCombo.xfdl

Case Insensitive filtering for Combo

By using filter method of Combo, several list values can be handled. We can implement case insensitive filter.

Combo_FilterNoLetter_0

Related Method

Filter()

This method shows only the record which satisfies the search condition from DataSet.

Main Source Content

/*
 * File Name   : Combo_FilterNoLetter
 * Description : Case Insensitive filtering for Combo
 */
this.btn_execute_onclick = function(obj:Button,  e:nexacro.ClickEventInfo)
{
 var nRow = this.ds_data.rowcount;
 var sData;
    
    this.ds_data.addColumn("COL2", "STRING", 255);
 for (var i = 0; i < nRow; i++)
 {
        sData = this.ds_data.getColumn(i, "COL1").toString().toUpperCase();
        this.ds_data.setColumn(i, "COL2", sData);
    }
    var sFilter = "COL2.toString().indexOf('" + this.edt_input.value.toUpperCase() + "') >= 0";
    this.ds_data.filter(sFilter); 
}

While using filter a separate column is created, this converts all characters to Upper case before processing filter.

Combo, filter

Source Location

Sample\Combo\np_Combo_FilterNoLetter.xfdl