jQWidgets Forums
Forum Replies Created
-
Author
-
As an aside, I’m very pleased with how well you implemented all the changes from v2.8.3 to v4.0.0. Other than working around this error, I’ve only had to make one small change to the our cellsrenderer function in jqxGrid. I wish other code that we update would be as trouble free.
I’ve been through the release history looking for where the problem was introduced. The only reference to jqxdata.export.js is in v3.9.1. This problem was actually introduced into the code in v3.8.1.
This error occurs because the saveAs function in jqxdata.export.js is being defined as a global function. In v4, line 4510 of jqxdata.export.js, jQuery is used like this: $(““)[0]. Because of the way we are using require.js, the $ function isn’t defined at that point, causing the error.
That was a change in v3.8.1. If you look at line 4511 in v4.0.0 jqxdata.export.js, you’ll see the way it was done in v3.8.0. If I comment line 4510 and uncomment line 4511, the code loads without errors. I can also just change line 4510 to jQuery(““)[0] to eliminate the error.
This is probably caused by the particular way in which we are using require.js to load the files.
Hi Peter,
I’m not saying the code needs to be changed, although it would be nice if jqxGrid would call the custom sort function with a consistent value for direction.
Instead, these are the values that it is called with, without my code ever calling ‘sortby’:
true, false, null, ‘asc’, ‘desc’, ‘ascending’, ‘descending’, {ascending: true, descending: false}, {ascending: false, descending: true}
If the documentation had said that, or your example custom function had handled those options, I would have no problem.
The documentation instead just says ‘asc’ or ‘desc’ can be used for the sort direction.
I’m just asking that the documentation explains that those values are used for direction.
Here’s a sample of the problem, using v3.2.1 and the sample custom sort function in your documentation online.
http://jsfiddle.net/donrfleming/U4mbJ/8/
The grid when first loaded should be sorted in descending order, as the source object is set up with these three members, per your documentation:
sort: customsortfunc,
sortdirection: ‘desc’,
sortcolumn: ‘productname’When the grid loads, the custom sort function is called with direction==’desc’ by invoking getstate,loadstate. That’s not recognized in your sample sort function, but is not null, so the function sorts in ascending order.
The same problem exists with jqxGrid(‘sortby’, ‘firstname’, ‘desc’) because desc is not handled so the grid is sorted in ascending order.
Click on a column header and it will sort properly, because direction set to true,false, or null is handled correctly.
Sort using the sort drop menu to see direction set to “ascending”, “descending”, or null.
Has this issue been fixed? Although I’d like to use the latest version, when I tried to use it a few weeks ago many other problems appeared with the grid. So we’re stuck with using v2.8.3 until I have time to work through the other problems.
May 14, 2013 at 9:45 pm in reply to: Export using local server example Export using local server example #21153try this: $(jqxgrid).jqxGrid(‘exportdata’,’csv’,’Application’, true, null, true, ‘/jqw/safe-file.php’);
Don’t forget the null, “true,null,true” not “true,,true”
May 14, 2013 at 9:32 pm in reply to: Placing Grid inside a splitter Placing Grid inside a splitter #21152This works for me. Set one of the column widths to ‘auto’
var columns = [
{text: “Description”, datafield: “description”, width: ‘auto’},
…
];$(“mygrid”).jqxGrid({
width: “100%”,
height: “100%”,
columns: columns,
…
}April 29, 2013 at 5:34 pm in reply to: bug in jqxGrid with jQuery UI modal dialogs bug in jqxGrid with jQuery UI modal dialogs #20270Forgot the version:
jQWidgets v2.8.1
-
AuthorPosts