c# - JqGrid sorting on href tag and not content -


I am currently trying to plug in jqGrid

I have an existing table I'm trying to implement the plug-in.

  & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {tableToGrid ("# myTable", {})}); & Lt; / Script & gt; & Lt; Table id = "myTable" & gt; & Lt; Thead & gt; & Lt; TR & gt; & Lt; Th & gt; Web site & lt; / Th & gt; & Lt; / TR & gt; & Lt; / Thead & gt; & Lt; Tbody & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; A href = "http://www.jsmith.com/4093" & gt; Hello & lt; / A & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; A href = "http://www.jsmith.com/4094" & gt; Bob & lt; / A & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; A href = "http://www.jsmith.com/4093" & gt; Loblas & lt; / A & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; A href = "http://www.jsmith.com/4093" & gt; The & lt; / A & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Tbody & gt; & Lt; / Table & gt;   

When I sort the column, then the command

Hello, Loblaz, Vahu, Bob

instead of

Bob, hello, lobla, carry

It seems that this is classifying href tags and not content.

Similar to this problem (just a different plug-in) -

The reason behind such a strange sorting is that the way you currently use jqGrid, the grid will have a string with string data string data:

  "\ N & lt; a href = \ "http: //www.jsmith.com/4093 \" & gt; Hello & lt; / a & gt; \ n "" \ n & lt; a href = \ "http: //www.jsmith.com/4094 \ "& gt; Bob & lt; / a & gt; \ n" "\ n & lt; a href = \" http: //www.jsmith com / 4093 \ "lobbles And Lieutenance / A & \ "\ n" "\ n & lt; A href = \ "http: //www.jsmith.com/4093 \" & gt; The & lt; / A & gt; \ N "  

How can you see the string with the" Bob "sub-string before" 4094. "So the string will be the last string in a sequential order.

You can improve the situation by using the second parameter of options to tableToGrid , but the best way to display the text displayed in the column (such as "Bob", "Hello") There is a clear separation of information and more than the URL data. Then on the column Torting will be exactly the same way you want it, so it is better not to use the tableToGrid function for your data and create jqGrid directly.

Because I do not know That source gives you information from url for texts is difficult to give you some recommendation for the best implementation. You can find examples of how to create links in jqGrid and I think that you have your purpose. Simple examples can be modified.

Comments