Doh!
I will clean the data and look for & and characters, i've done it in the past, just slipped my mind.
Is there an easy way to debug…basically how did you got the link you sent me..just knowledge or from firefox debugger? I have not used the debugger yet in firefox (should do a tutorial really on how to use it), but that link seem to be at the xml stage rather than javascript.
Thanks again Mark
Regards
MarkC
Hi Mark,
Yes i agree, but the way i was designing the datbase each grid column will also have a datatype field associated to it e.g.
col1 varchar(40)
col1datatype char(1)
col2 varchar(24)
col2datatype char(1)
.
.
. and so on
where the datatype is I,T,F,D (integer,text,float,Date). This allows the main data table of 200,000 records to all be VARCHAR(40) but sorted by a particlaur type. (presuming data is valid!!!!) by casting.
So i will interpret the I,T,F,D on the server side and SQL CAST() it, it will then be in the correct form for the grid so no need to use sorttype.
For a one off project i would just define the datatypes at the datbase level, but this is supposed to be a generic design of upto 20 columns each column having different types of data…and as i mentioned earlier there is a CATEGORY field, and col1 for categoryA could be a date, but col1 for categoryB could be an integer….hence the 'warpping of teh data in a VARCHAR(40)
Thanks for the guidance once again….when i eventually get paid for this i'll have to donate some beer money!!!
Regards
MarkC
I have grasped the 'local' sorttype concept now. I tested loading 20 records of type TEXT (defined in database) and set it to sorttype:'int' with with datatype: 'local', refreshed grid and it was sorted as if it was integer.
But, i am using 200,000 records (LIMIT 20 at a time SQL) with scroll:true, so no paging.
Is it possible to switch between 'local' and 'xml' when we start scrolling, similar to when we start paging (onPaging). So as we scroll and retrieve the xml data, when it stops, i set it to local, refresh grid and data takes on the from of an integer again.
Also, i am filterng the data by searching on keypress, so would have to do something similar , switch to XML when keypressed get data, swicth back to local,refresh grid.
Regards
MarkC
Thanks Tony,
I will have a look.
I am using scrolling not paging as we are talkng about 200,000 records and i am allowing the user to auto incremtn search on keypressing. (like your bigset.php demo)
But i'll have a look into the local setting.
regards
MarkC
Hi MarkW,
Will have a look at your suggestions.
Regards
Mark C.
I can do it at SQL level:
strSQL = “SELECT DOCID,CAST(INDEX1 AS SIGNED) as index1,INDEX2 FROM DOCUMENTS ” &strWhere
strSQL = strSQL & ” ORDER BY “&strIdx&” “&strOrd&” LIMIT “&strStart&” , “&strLimit&” “
this takes VARCHAR(20) INDEX1 and casts it into an signed integer, so when ordering it will be corectly sorted like an integer.
Works fine. BUt i thought the grid would do it using sorttype!!!
My colModel is fine, {name:'col1', index:'index1', align:'right', sorttype:'int', sortable:true, width:80}
Simply…what is sorttype? maybe it's not what i thought it was, as in take any data and sort it like it was an integer?
The reason i get a sorted column like
1
10
2
2000
300
is that the SQL has already sorted the data based on it's datatype (VARCHAR) This is then parsed into the XML cells. EWhixh is then displayed in the grid. I thought the sorttype might do something with teh xml ordering, by saying now define it as an integer even though it is a varchar. Basically, sort a VARCHAR as if it was an integer to get 1,2,10,300,2000, hence my first question why use sorttype if it has already been sorted as a varcgar,data,integer,float by the SQL:
strSQL = “SELECT DOCID,INDEX1,INDEX2 FROM DOCUMENTS ” &strWhere
strSQL = strSQL & ” ORDER BY “&strIdx&” “&strOrd&” LIMIT “&strStart&” , “&strLimit&” “
and parsed into XML in that order.
Regards
MarkC
Hi Tony,
Yes i am using sorttype: 'int'
Maybe my post was too long winded…simply put….
If you have a column that in MySQL is defined as varchar(10) and it holds some data say 5 records
Thanks Mark,
That did the trick.
Regards
Mark C.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top