Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
508
Setting WebDatePicker value in WebHierarchialGrid row
posted

I currently have a WebHierarchialGrid working great but when I try to set the value of a WebDatePicker control in a row, I lose the WebDatePicker control. Let me explain further...my rows have a dropdown and a webdatepicker control in them. When a choice is made in the dropdown, I would like to default the value of the webdatepicker to the current date. Right now it turns the control into a label when I set the date. The user loses the webdatepicker functionality. How can I do this?

Current code:

var oldValue = childGridView.get_rows().get_row(activeRow._index).get_cell(10).get_value();

if (oldValue != null) {

childGridView.get_rows().get_row(activeRow._index).get_cell(10).set_value(vCurrentDate.format("MM/dd/yyyy"));

}

  • 33839
    Suggested Answer
    posted

    Hi koneal,

    When you call set_value on a cell, we set the text of the <td> to the value.  You can also pass a second parameter 'text', that can be different than the value.  It sounds like your cell is part of a templated column that has a date picker.  If this is the case, and you want to set the value of the date picker, you need to find the javascript object using $find(id) where id is the id of the date picker in that cell.  Then call set_value() on that object.

    regards,

    David Young