|
Title: How to manage datebox with Date as long integer? Post by: bbones on April 06, 2015, 07:00:32 AM Hi, again.
Help me pls :) Server sends me a Date value as long integer. I can format it to show with formatter like Code:
Code: dateParser : function(s){but since this moment field value is Date (or String) and I can't find how to put it in edited row as Long again before sending it back to server. What is rigth way to write formatter and parser? Or what is a right strategy at all? Thanks for any help Title: Re: How to manage datebox with Date as long integer? Post by: yamilbracho on April 06, 2015, 06:44:47 PM I think you could use getTime() method of javascript Date
Title: Re: How to manage datebox with Date as long integer? Post by: stworthy on April 06, 2015, 07:13:09 PM A better way to solve this issue is to extend a new editor that can convert between long numeric and date value.
Code: <script> Please notice that the 'formatter' and 'editor' should be defined correctly on the datagrid column. Code: <th data-options="field:'datefield',width:100, Title: Re: How to manage datebox with Date as long integer? Post by: bbones on April 07, 2015, 06:02:55 AM It works!
Really flexible thing. formatter/parser was isolated to JS module - my sintax from there Tnx, indeed! Title: Re: How to manage datebox with Date as long integer? Post by: bbones on May 08, 2015, 05:47:12 AM One step more...
How to use datebox2 with input field in form? I need to extend another editor? BR BB |