[Dojo-interest] Re: Strange filteringTable sort behaviour
troyf
troyf at adbeast.com
Mon Jan 29 12:15:19 MST 2007
Thanks, but ugh! I just got through berating one of my colleagues for
missing the unique tr value :( I should practice what I preach.
In a related question are there any best practices for influencing sort
order? Consider a column that contains product names with links to a page
containing those details. You might see something like:
<a href="prod.asp?id=124">Widget</a>
<a href="prod.asp?id=123">Doodad</a>
<a href="prod.asp?id=223>Thingamajig</a>
To a user, sorted, this might appear as Doodad, Widget, Thingamajig because
the literal string is being sorted, not the content the user sees. One
workaround I have used is to make the very begining of the literal string
contain something like <span value="Doodad"></span> to force the sort into
something the user would expect.
Is this a fair approach or is there a better approach?
t
"Tom Trenka" <dojo-interest at dept-z.com> wrote in message
news:8667579.post at talk.nabble.com...
>
> If you aren't setting unique keys on each row in the table (by either
> including a value="something unique" attribute on the tr element in the
> HTML
> form, or including an Id property on each of the JSON objects you are
> using
> the table to represent), then the table often exhibits this behavior.
> *Make
> sure* you are setting each row to have a unique key, and then try the
> sorting again.
>
> If you already are, then I'd say that you've got something going on where
> the table is trying to treat a column as a specific data type and failing
> for some reason. String is the default (as pwagener said) but any data
> type
> that supports a valid toString or valueOf method should work.
>
> trt
>
>
> pwagener wrote:
>>
>> Hi Troy,
>>
>> I admit I have virtually no experience with the Dojo FilteringTable,
>> so this is a stab-in-the-dark.... But when I've seen similar
>> behavior in other GUI tables, it's typically because I'm not sorting
>> on the data type I think I'm sorting on. For instance, a given
>> column is supposed to be filled with numbers, but the data type is
>> really strings. So, sorting by that column orders my data as "1",
>> "11", "2", "28", "5", etc etc.
>>
>> So, are you sure you've got your data type right?
>>
>> Like I said, just a stab in the dark. It's Friday afternoon;
>> unfortunately I can't guarantee I'm very useful right now :)
>>
>>
>> Peter
>>
>>
>> On Jan 26, 2007, at 2:52 PM, troyf wrote:
>>
>>> Has anyone seen filtering sort in such a way that the 2nd and last
>>> rows always stay fixed and only portions of the column are sorted
>>> properly.
>>>
>>> My original dataset was quite large and I've gradually pared it
>>> down to half a dozen rows, yet the same behaviour remains. Second
>>> row never budges, last row never budges, and there are groupings of
>>> sorted rows.
>>>
>>> has anyone seen this before?
>>> _______________________________________________
>>> Dojo FAQ: http://dojo.jot.com/FAQ
>>> Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
>>> Dojo-interest at dojotoolkit.org
>>> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>>
>> _______________________________________________
>> Dojo FAQ: http://dojo.jot.com/FAQ
>> Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
>> Dojo-interest at dojotoolkit.org
>> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/Strange-filteringTable-sort-behaviour-tf3125661.html#a8667579
> Sent from the Dojo mailing list archive at Nabble.com.
>
> _______________________________________________
> Dojo FAQ: http://dojo.jot.com/FAQ
> Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> Dojo-interest at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
More information about the Dojo-interest
mailing list