Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Strange Problem with Filter Builder

    I am using simple filterBuilder.
    Everything is working fine; except 1 thing, some of the text field operators are not coming in the drop down list.

    Following is my code :



    function fetchTextOperators(){
    return new Array("equals","iEquals","notEqual","iNotEqual","contains","iContains","notContains","iNotContains","startsWith","iStartsWith","isNull","notNull");
    }
    function fetchIntegerOperators(){
    return new Array("equals","notEqual","greaterThan","greaterOrEqual","lessThan","lessOrEqual","isNull","notNull");
    }
    function fetchBooleanOperators(){
    return new Array("equals","notEqual","isNull","notNull");
    }
    function fetchDateOperators(){
    return new Array("equals","notEqual","greaterThan","greaterOrEqual","lessThan","lessOrEqual","isNull","notNull");
    }

    var customerSearchFields = [
    {name: "lastName",title: "Last Name", type:"text"},
    {name: "firstName",title: "First Name", type:"text"},
    {name: "id", title: "ID", type:"integer"},
    {name: "isSupervisor", title: "Supervisor", type:"boolean"},
    {name: "createDate", title: "Create Date", type:"date"}
    ];


    isc.DataSource.create({
    ID: "customersSearchDS",
    fields: customerSearchFields,
    dataFormat: "json",
    clientOnly:true
    });

    customersSearchDS.setTypeOperators("text",fetchTextOperators());
    customersSearchDS.setTypeOperators("integer",fetchIntegerOperators());
    customersSearchDS.setTypeOperators("boolean",fetchBooleanOperators());
    customersSearchDS.setTypeOperators("date",fetchDateOperators());

    isc.FilterBuilder.create({
    ID: "advanceSearchFilter",
    dataSource: customersSearchDS,
    showSubClauseButton:false,
    topOperator:'and',
    maxDepth: 1
    });


    In the above code, if I select ID/isSupervisor/createDate field then the corresponding integer/boolean/date operators that I have specified are coming.

    But in case of text fields, all the specified text operators do not come. Maximum of the operators are in the drop down but there are few that do not come. {"iContains" , "iNotContains" ,"iStartsWith" are missing}
Working...
X