how to prevent Treepanel autohide leading zero and auto convert text to datetime

  1. #1

    how to prevent Treepanel autohide leading zero and auto convert text to datetime

    Dears,
    here is the problem in screenshots

    this field stored as nvarchar in sql

    Click image for larger version. 

Name:	1.PNG 
Views:	8 
Size:	7.8 KB 
ID:	25537

    then it will appear as date like here:

    Click image for larger version. 

Name:	1.PNG 
Views:	10 
Size:	11.7 KB 
ID:	25538


    this also is happened when you use leading zero like 0001 , in the treepanel it will appear just 1


    thank you
  2. #2
    Hello @odaysaed!

    Specify the column as a string type via its corresponding model field. But as we have no idea how you define your grid we cannot tell how exactly you should change your code to attain that. You probably are in automatic field type and, as the input "looks like" a date, then the assumed conversion happens.

    This is the Ext JS documentation for model field type's string, it may help you infer how to use it depending on how your page is drawn: Ext.data.field.String

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Dear,
    thanks for the reply, I already changed the model field to string and still reading it as date or auto hide leading zeores so
    i think it will read it as int sometimes, this happened only in tree panel not in grid panel.

    aspx page
    Click image for larger version. 

Name:	1.PNG 
Views:	6 
Size:	48.5 KB 
ID:	25540

    cs code behind
    Click image for larger version. 

Name:	2.PNG 
Views:	5 
Size:	36.2 KB 
ID:	25541

Similar Threads

  1. [CLOSED] mssql datetime can not convert to proper date format?
    By hdsoso in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 15, 2014, 12:05 AM
  2. Replies: 2
    Last Post: Dec 13, 2012, 4:43 AM
  3. GridPanel convert encrypted text characters
    By ismailkocacan in forum Examples and Extras
    Replies: 1
    Last Post: Nov 04, 2011, 4:42 PM
  4. Using JS To Convert Text
    By juan_pablo in forum 1.x Help
    Replies: 1
    Last Post: May 30, 2010, 7:28 PM
  5. Replies: 2
    Last Post: Aug 31, 2009, 6:03 PM

Tags for this Thread

Posting Permissions