$(#xxxx).flexAppendData(data, insPos)
data は、flexAddData と同じく JSON or XML データ(1行分)
insPosは、行を追加する位置
':first' or 指定しない : 表の先頭に追加
':last' : 表の最後に追加
とりあえず、自分の期待した動作はできるようになったので、パッチを載せておきます(1.0b3用)。
$diff flexigrid.js flexigrid_orig.js
363c363
< addData: function (is_empty, rowPos, data) { //parse data
---
> addData: function (data) { //parse data
511,533c511,516
< if (is_empty) {
< $('tr',t).unbind();
< $(t).empty();
< }
< if (rowPos == ':last')
< $(t).append(tbody);
< else
< $(t).prepend(tbody);
< if (!is_empty) {
< var i = 0;
< $('tbody tr', g.bDiv).each
< (
< function () {
< if (i % 2 && p.striped)
< $(this).addClass('erow');
< else
< $(this).removeClass('erow');
< i++;
< }
< )
< }
< this.addCellProp(rowPos);
< this.addRowProp(rowPos);
---
> $('tr',t).unbind();
> $(t).empty();
>
> $(t).append(tbody);
> this.addCellProp();
> this.addRowProp();
637c620
< success: function(data){g.addData(true, '', data);},
---
> success: function(data){g.addData(data);},
676c659
< addCellProp: function (rowPos)
---
> addCellProp: function ()
678,679c661,662
< $('tbody tr'+rowPos+' td', g.bDiv).each
< // $('tbody tr td',g.bDiv).each
---
>
> $('tbody tr td',g.bDiv).each
735c718
< addRowProp: function(rowPos)
---
> addRowProp: function()
737,738c720
< $('tbody tr'+rowPos, g.bDiv).each
< // $('tbody tr',g.bDiv).each
---
> $('tbody tr',g.bDiv).each
1078c1060
< g.addCellProp('');
---
> g.addCellProp();
1081c1063
< g.addRowProp('');
---
> g.addRowProp();
1460,1468c1442
< $.fn.flexAddData = function(data) { // function to replace data to grid
<
< return this.each( function() {
< if (this.grid) this.grid.addData(true, '', data);
< });
<
< };
<
< $.fn.flexAppendData = function(data, insPos) { // function to add data to grid
---
> $.fn.flexAddData = function(data) { // function to add data to grid
1470d1443
< if (insPos == undefined) insPos = ':first'
1472c1445
< if (this.grid) this.grid.addData(false, insPos, data);
---
> if (this.grid) this.grid.addData(data);
1513c1486
< })(jQuery);
---
> })(jQuery);
0 件のコメント:
コメントを投稿