You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The changes made for Issue #1752 breaks the ability to remove/reset a sort when remote sorting is used.
Prior to this change, clearing a sort used to work by:
Using Table.cleanSort(), and
Setting SortOrder = undefined, SortName = '' in the table options.
Doing this with 4.2.0 (I would assume in 4.1.5 - I just tried upgrading from 4.1.4) results in BootstrapTable throwing the error: "The type of sort field and order should be both with String or Array".
The changes made for issue #1752 do not take into account/provide any way to reset the current sort without triggering the above error. i.e. TableDataStore.setSortInfo(sortOrder, options.sortName) enforces that sortOrder must never be undefined.
The text was updated successfully, but these errors were encountered:
Yes, using remote sorting.
Yes, occurs when Option.SortOrder = undefined and Options.SortName = ''.
This commit introduced the problem, because the function it calls validates that SortOrder must be the same type as SortName - but when there is no sort SortOrder (previously) was undefined. So the test fails and throws the Error "The type of sort field and order should be both with String or Array". 06b3560
@dawnmist I see, I think the sortName is supposed to be undefined right? i know this patch will break your program and make you feel this might be a bug. Yes, that's a problem that I didn't handle it well at before. Anyway, I'll suggest to clean the sort status by undefined in this circumstances.
The changes made for Issue #1752 breaks the ability to remove/reset a sort when remote sorting is used.
Prior to this change, clearing a sort used to work by:
Doing this with 4.2.0 (I would assume in 4.1.5 - I just tried upgrading from 4.1.4) results in BootstrapTable throwing the error: "The type of sort field and order should be both with String or Array".
The changes made for issue #1752 do not take into account/provide any way to reset the current sort without triggering the above error. i.e. TableDataStore.setSortInfo(sortOrder, options.sortName) enforces that sortOrder must never be undefined.
The text was updated successfully, but these errors were encountered: