Announcement

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

    single day as initialcriteria for listgrid

    Hi
    We are using v8.3p_2013-03-21/PowerEdition Deployment 2013-03-21

    I have a datasource feeding a listgrid. Among others it has a datetime field and another field of type integer on which I want to do initial filtering.
    I want to provide an initialcriteria for the listgrid for today i.e. from 04/19/2013 00:00 to 04/19/2013 23:59 and on the other integer type field.

    This is what I tried :
    initialCriteria:[
    {
    fieldName: "todotype", value:1
    },
    { fieldName: "todoplandate", operator: "greaterOrEqual", value: (new Date(new Date().setUTCHours(00, 00, 00, 0))) },
    { fieldName: "todoplandate", operator: "lessOrEqual", value: (new Date(new Date().setUTCHours(23, 59, 59, 0))) }
    ],

    but its not working as expected.

    Can you please help me figure this out?

    #2
    Ok
    Got this working as below :

    var advancedCriteria = {
    _constructor: "AdvancedCriteria",
    operator: "and",
    criteria:[
    {fieldName: "todotype",operator: "equals", value:1},
    { fieldName: "todoplandate", operator: "greaterOrEqual", value: (new Date(new Date().setUTCHours(00, 00, 00, 0))) },
    { fieldName: "todoplandate", operator: "lessOrEqual", value: (new Date(new Date().setUTCHours(23, 59, 59, 0))) }
    ]
    };

    and then inside the listgrid :
    initialCriteria:advancedCriteria,

    Interested to know if there is a better way of doing this?

    Comment


      #3
      That's now a correct AdvancedCriteria declaration. In what way could it be "better"?

      Comment

      Working...
      X