Hi all, 1 month ago I worked in project, where I wrote custom widget(table with header sort event).
And I downloaded very pretty javascript library(sorttable, http://www.kryogenix.org/code/browser/sorttable/), but I couldn't understand, why when I include this library in page with Ms Ajax control's, exceptions try to fuck my browser and brain.
After google, I found blog of japan guy(don't remember link, butthankful for him) some information about forEach method, that's uses in MS Ajax and sorttable library. For fixing this bug, you may try to replace forEach method in sorttable library to simple for loop, example (in init()):
/*forEach(document.getElementsByTagName('table'), function(table) {
if (table.className.search(/\bsortable\b/) != -1) {
var index = table.id.indexOf("_header");
var sortingFields = table.id.substring(0, index);
sorttable.makeSortable(table, sortingFields);
}
}); */
for(i=0;i < document.getElementsByTagName('table').length;i++)
{
table=document.getElementsByTagName('table')[i];
if (table.className.search(/\bsortable\b/) != -1) {
var index = table.id.indexOf("_header");
var sortingFields = table.id.substring(0, index);
sorttable.makeSortable(table, sortingFields);
}
};
That's all, thanks for reading.
Подписаться на:
Комментарии к сообщению (Atom)
Комментариев нет:
Отправить комментарий