Announcement

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

    Multiple condition checking in Criteria /AdvancedCriteria

    Coudl you please help us from following issue:

    I have data comes from database as below:

    employee name, group, group header, Employee Parent

    Group values are A, B, C and D and emp a is with Group A, and Group B.

    I want to filter employees based on group A and group B.
    So I provided the criteira

    crt = new crt()
    crt.addCriteria("Group", "A");
    crt.addCriteria("Group", "B");

    But it is executing the last critiera that is group B.

    I tried with Advanced Criteria with in operator and other conditions such as control header is true and employee is null.

    nothing seems to be working in this case.

    could you please suggest how to get two values from the same column (Group) and also checking null for anther in the same criteira.

    #2
    If you want to explicitly check for null, you will need an AdvancedCriteria. You can use the inSet operator for the groups and the isNull operator for the null check.

    There's a code sample here showing how you can create one in JSNI.

    Comment


      #3
      I am able to get is null condition but in set conditon doesn't works along with isnull. My request is how to get multiple conditions such as is null for one field, checking Group A or Group B for one field and another condition such as header is true.

      The advanced criteria works well for one conditon and it does not work if i add multiple condtions.

      Do I need to create multiple criterias and add to one criteria.

      I am using smartgwtPower 2.1

      Comment


        #4
        Did you note the boolean operators such as "and" and "or"? You can create whatever arbitrary set of conditions you want with those.

        Comment

        Working...
        X