Hello tony,
Just sent you an email. Many thanks for your help.
Forgot to mention in the mail that if i use the onPaging event with the same exact code as the gridComplete event and combine them both in the grid, the system works fine.
Thanks
Frederico
Hello tony,
Neither is true. Thats the strange part. Here's an example of the output of both arrays:
selected_jq_ids:
298,295,290,289,288,287,286,285,284,283
getDataIDs():
298,295,290,289,288,287,286,285,284,283,282,281,280,279,278,
277,276,275,274,273,272,271,270,269,268,267,266,265,264,263
It doesnt select any of them. But this ONLY happens when changing the number of rows in the select box. If i change page or do searches it works fine.
Thanks,
Frederico
Ok, its all working now. For those interested I posted the code on pastebin. You'll need the jquery cookie plugin:
Maintain selection changing pages:
http://pastebin.com/f778c1db *UPDATED*
Little hack to the multiselect function. starts on line 1276 of grid.base.js (hope this gets included in future releases):
I'm not really a javascript programmer, so any improvements are welcome. Please post them here.
Thanks to tony for all his support.
Ok, i hacked a line in grid.base.js and had the result i wanted:
After line 1296, i added:
ts.p.selarrrow= ts.p.selrow = this.id;
And on line 1299, I commented:
ts.p.selarrrow = []; ts.p.selrow = null;
This way, the event onSelectAll has the same behaviour as onSelectRow.
If this doesnt break anything,
Hello Tony,
Thanks for the fast reply.
That argument sure helps, but when I click on the top checkbox (the one that selects all the rows in that page) it doesnt call the onSelectRow event, instead, it calls the onSelectAll event. Is there a way to call the onSelectRow event anyway for each item when clicking this checkbox?
Edit:
I realised that onSelectAll also has that second argument, but it doesnt return the id's when deselected like onSelectRow.
Thanks,
Frederico
Hello again,
I tried doing this with the onSelectRow event and it works, the problem is i use the multiselect option that uses the onSelectAll event.
Unlike onSelectRow, that always returns the id weither you are selecting or deselecting, onSelectAll only returns the id's that you select. This is a problem because i can add the selected row's id to a cookie, but cannot remove them because i dont know which were removed.
Another problem is when i call the setSelection function to reselect the rows on page change, it calls the onSelectRow event, and because i'm using a code that works like toggle to add and remove id's from the cookie (if it exists removes it, else it adds it) it removes all of the selected id's.
I hope i made myself clear, here's the code i use so someone can take a look:
Please ignore the messy code, its just a prototype.
Thanks,
Frederico
Solved. It as a PHP problem. Thanks and sorry for posting in the wrong forum.
hey sv72,
That worked great on IE! I have some problems in Firefox tho, but i think its css related and i will fix it soon.
Thanks!
I'm using the following method with the jquery “dimensions” plugin:
$(window).bind('resize', function() {
jQuery(”#s1list”).setGridWidth($(window).width());
});
In firefox its fine, but in IE 7 the horizontal scroll is all messed up and it shows a vertical scroll even with height: 100% after resizing. Any input on this?
Thanks!
Thank you! Great work.
Thanks for the suggestions, I have some ideas how to do this, when i'm done i'll post here.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top