I have a grid with multicolumn sorting enabled. The user needs to be able to see what the currently selected sort order is. I've created a button and attached the following javascript to execute via the onclientclick event.
It identifies the grid and the mastertableview with no trouble, but nothing is returned by the get_sortExpressions(), so the resulting message is empty.
What am I missing?
Thanks!
It identifies the grid and the mastertableview with no trouble, but nothing is returned by the get_sortExpressions(), so the resulting message is empty.
What am I missing?
Thanks!
function showSortOrder() { var grid = $find("<%=gridResults.ClientID %>") alert("Grid = " + grid); var mstrvw = grid.get_masterTableView(); alert("mstrvw = " + mstrvw); var sortExpressions = grid.get_masterTableView().get_sortExpressions(); alert("sortExpressions = " + sortExpressions); // alert("sortExpressions length = " + sortExpressions.length); var msg = "The current sort order is\n"; // for (i = 0; i < sortExpressions.length; i++) // { // var expression = sortExpressions[i]; // var fieldName = expression.get_fieldName(); // var sortOrder = expression.get_sortOrder(); // msg = msg + fieldName + " (" + sortOrder + ")\n" // } // alert(msg); alert(msg + sortExpressions.toString()); }