TechnoCrat
TechnoCrat

Reputation: 2065

How to override sort method for any column in dgrid (gridFromHtml)?

Is there any way to override the sort method and write our own for sorting the particular column in dgrid(gridFromHtml)?

Upvotes: 2

Views: 953

Answers (1)

Leftium
Leftium

Reputation: 17903

Sorting is done in _setSort() of List.js. It's possible to override, but the underbar is a convention that means "private method."

There's a better (although more complex) method: attach your GridFromHTML to a store sub-classed from dojo/store/Memory. Override the Memory store's query() method, which accepts sort parameters as the 2nd parameter. dGrid will automatically call this method whenever it needs to list/sort data.

Anyways, I generally find the array-backed Grid too limiting and automatically use the store-backed OnDemandGrid.

Upvotes: 2

Related Questions