1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    8
    Vote Rating
    0
    madhav.msd is on a distinguished road

      0  

    Default Unanswered: Date column in the grid displaying date as in String

    Unanswered: Date column in the grid displaying date as in String


    Hello Team,

    With respect to the request raised in Q&A(http://www.sencha.com/forum/showthre...s-4.1&p=906871).

    We having an issue with the Date column in the grid. We using a custom datepicker which will show only the MONTH and YEAR. Our system will calculate the date depends on the requirements.

    My grid has the date value, when i want to modify it by clicking the datepicker, the datepicker is not showing the cell date value, instead it is displaying blank for the first time. And then it is displaying the selected value in the datepicker on further modification.

    Please note:
    The same datepicker is used by another grid by the xtype as datacolumn where it is working fine as expected. We are facing the issue only in the dynamic grid.And also the format config is not working for the Date column, so we converting the date value as per our desired format dd-mmm-yyyy by a function and it will return the value as string.

    Find the screen shot attached for this issue.
    Attached Images

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Answers
    3540
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Is the value being set on the field?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    8
    Vote Rating
    0
    madhav.msd is on a distinguished road

      0  

    Default


    Thanks for you response!...

    When data comes from the server side, my store has all values and displaying in the grid properly.

    While modifying the date in the client side, Not sure on that. Because we calculating the date for the selected Month and year, and manually using set method to set values.(date column belong to the associated model, that's why we using set method to set the value to the record)

  4. #4
    Sencha User
    Join Date
    Sep 2012
    Posts
    8
    Vote Rating
    0
    madhav.msd is on a distinguished road

      0  

    Default


    After implementing the below code, all the value and rawValue has been modified with my new dates. But the monthpicker is not display the value which I set to it. By default it is showing current system date as selected and the textfield is empty.

    var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
    clicksToEdit : 1,
    listeners : {
    'beforeedit' : function(editor, e, eOpts) {
    if (e.record.get('leaf')) {

    if(e.colIdx > 4){
    var montheditor = e.column.getEditor(e.record,null);
    var dateValue = e.record.myDates().getAt(e.colIdx - 4).get('date');
    montheditor.setValue(dateValue);
    montheditor.getPicker().setValue(dateValue);
    }

    }else{
    e.cancel = true;
    }
    }
    });

Thread Participants: 1