[CLOSED] How to dynamically add either Combobox or DateField to Gridpanel Column Editor from code behind

Page 2 of 2 FirstFirst 12
  1. #11
    According to
    var dt = Date.parseDate(e.value, 'm/d/Y');
    the RecordField's value should look as:
    "02/05/2011"
  2. #12
    Daniil,

    When the grid is binded the initial value which comes from the grid, when edit is pressed is
    "2012-02-07T00:00:00".
    So i tried the following

    var dt = Date.parseDate(e.value, 'c');
    Which gave me a valid date. Even after setting this valid date i am not able to see it in the datefield.

    Note: I am getting two different date formats from the grid.
    1. When the grid data is bound i am getting this format
    "2012-02-07T00:00:00"
    during edit.
    2. When a value is set from the datefield i am getting this format
    "Mon Fec 6 00:00:00 UTC+0530 2012"
    during edit.

    So how do i parse a consistent date value like this
    "02/06/2012".
  3. #13
    I would set up the RecordField's Type to Date. In this case you won't need to "parseDate" with the setEditor function.

    If you bind strings from server, you will need to set up a respective DateFormat (ASP.NET date-time format string), if you bind DateTime object you don't need to set up DateFormat.

    To show this RecordField in a GridPanel, I would use a DateColumn with a respective Format (ASP.NET date-time format string).

    For DateField you also can set up the format config option (on client side you should set up a ExtJS/PHP date-time format string).

    Hope this helps.
  4. #14
    Hi Daniil, can you write this sample for MVC I am trying but I had some error. Thanks
  5. #15
    Hi @jogave,

    It would be best to start a new thread, and post a sample demonstrating as much of the scenario as possible. Please remove all unnecessary code from your sample. Only the absolute minimum required to reproduce the issue.

    The following forum post outlines tips for posting to the Ext.NET forums:
    http://forums.ext.net/showthread.php...ing-New-Topics

    Thanks.
    Geoffrey McGill
    Founder
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 3
    Last Post: Feb 21, 2012, 6:40 AM
  2. Replies: 1
    Last Post: Feb 19, 2012, 1:07 PM
  3. [CLOSED] gridpanel with combobox column editor
    By Marcelo in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Dec 30, 2011, 6:53 PM
  4. Replies: 2
    Last Post: Mar 22, 2011, 3:40 PM
  5. Replies: 13
    Last Post: Sep 06, 2010, 7:51 PM

Tags for this Thread

Posting Permissions