newsanti Posted September 15, 2023 Share Posted September 15, 2023 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 15, 2023 Share Posted September 15, 2023 2 hours ago, newsanti said: Hello, In fact, this is the natural order. Quote Link to comment Share on other sites More sharing options...
newsanti Posted September 15, 2023 Author Share Posted September 15, 2023 Just now, Sherzod said: Hello, In fact, this is the natural order. code-1 code-2 ... code-10 this is correct order. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 15, 2023 Share Posted September 15, 2023 4 minutes ago, newsanti said: this is correct order. For example, try sorting this in Excel... 1 Quote Link to comment Share on other sites More sharing options...
newsanti Posted September 15, 2023 Author Share Posted September 15, 2023 2 hours ago, Sherzod said: For example, try sorting this in Excel... Quote Link to comment Share on other sites More sharing options...
Oliver Morsch Posted September 16, 2023 Share Posted September 16, 2023 This is the sorting in Excel: You are sorting it as string and that is the correct order for a string. Either you name it "Code-01", "Code-02", ... or must sort by it an integer column or calculated integer value. 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 16, 2023 Share Posted September 16, 2023 Also if there is a constant at the beginning and it adheres to a certain condition, say %s%d, then a "custom sort" function can be used. Quote Link to comment Share on other sites More sharing options...
Tokay Posted September 16, 2023 Share Posted September 16, 2023 Actually your issue has nothing to do with UniGUI. You should searh for solution for Tclientdataset, for example: https://stackoverflow.com/questions/17921635/how-to-override-sort-mechanism-of-tclientdataset Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 16, 2023 Share Posted September 16, 2023 Also this post may help you: https://spin.atomicobject.com/2012/07/20/simple-natural-sorting-in-extjs/ Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 26, 2023 Share Posted September 26, 2023 @newsanti I'm checking. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 26, 2023 Share Posted September 26, 2023 Local sorting on the client side. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 27, 2023 Share Posted September 27, 2023 One possible solution: UniDBGrid.ClientEvents.ExtEvents -> function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) { sender.getStore().setRemoteSort(false); var col = columns[1]; //second column col.setSorter({ sorterFn: function(a, b) { a = a.data[col.dataIndex]; b = b.data[col.dataIndex]; return a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' }) } }); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.