SMART datagrid v.1 > Classes > GridDataSet
除了向rows参数传递XML对象之外,与appendRows是相同的。
// 如果rowEvents为false,就会在提交所有行的添加时,触发事件。
ds.onRowsInserted = function (ds, row, count) {
console.log(row + '已在第 个行位置,添加' + count + '行。';
};
// 如果rowEvents为true,就会在每次添加各个行时,触发事件。
ds.onRowInserted = function (ds, row) {
console.log(row + '已在第 个行位置,添加一个行。';
};
// rows参数是XML对象。
// 如果count为-1,就会添加rows的所有行,而如果大于0,就会添加相当于Math.min(count, rows.length)的数量。
//|
|
var rows = '<rows><row id="1" userid="smccoy" company="Fivespan" first_name="Jane"/><row id="2" userid="smccoy" company="Fivespan" first_name="Jane"/></rows>';
rows = DataLudi.parseXml(rows).documentElement.childNodes;
ds.appendXmlRows(rows, 0, -1, false);