Using RemoveAllRows function with DIV based pattern

For quite long time we were not able to use DIV based HTML in our DWR based applications.

DWR supports only tables to remove and add rows for any data. Now if your HTML contains DIV based pattern you can not clear and re-populate rows, you need to convert the design to TABLE.

I have modified removeAllRows function frovided by util.js and achieved same for DIV
 
dwr.util.removeAllRowsDiv = function(ele,options) {
return;
ele = document.getElementById(ele);
if (!options) options = {};
if (!options.filter) options.filter = function() { return true; };
if (ele == null) return;

var child = ele.firstChild;
var next;
while (child != null) {
next = child.nextSibling;
if (options.filter(child)) {
ele.removeChild(child);
}
child = next;
}
};


So Now by providing your parrent DIV id you can and pattern div Id you can acheive the same result.

0 comments: