Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

drag and drop updating the recordset correctly

  • Loading branch information...
commit eec308bc39f47fcfd1a27311fb139b76d58e9fdd 1 parent 6c20c93
@markmansour authored
Showing with 6 additions and 6 deletions.
  1. +2 −2 assets/datatablegrouper.css
  2. +4 −4 groupeddatatable.js
View
4 assets/datatablegrouper.css
@@ -87,12 +87,12 @@
* -------------------------------------------------
*/
.yui-skin-sam .yui-dt td {
- border-bottom: 2px solid transparent;
+ border-top: 2px solid transparent;
}
.yui-skin-sam .yui-dt .dragging-over td
{
- border-bottom: 2px solid red;
+ border-top: 2px solid red;
}
.yui-skin-sam .yui-dt .drag-source-row td
View
8 groupeddatatable.js
@@ -383,7 +383,7 @@
* @param index {Number} (optional) RecordSet position index at which to add data.
*/
/** move this out into a Dragable Row abstraction **/
-addRow : function(oData, index) {
+addRow : function(oData, index, tableIndex) {
if(Lang.isNumber(index) && (index < 0 || index > this._oRecordSet.getLength())) {
return;
}
@@ -426,7 +426,7 @@ addRow : function(oData, index) {
var recIndex = oArg.recIndex;
var elNewTr = this._addTrEl(oRecord);
if(elNewTr) {
- recIndex += this.groupRowsAboveRecord(index);
+ recIndex += this.groupRowsAboveRecord(tableIndex || index);
var elNext = (this._elTbody.rows[recIndex]) ? this._elTbody.rows[recIndex] : null;
this._elTbody.insertBefore(elNewTr, elNext);
@@ -881,12 +881,12 @@ getRecordIndex : function(row) {
console.log(srcData);
if(this.srcDataIndex > destDataIndex) {
console.log("this.srcTableIndex > destIndex");
- this.dataTable.addRow(srcData, destDataIndex);
+ this.dataTable.addRow(srcData, destDataIndex, destTableIndex);
this.dataTable.deleteRow(this.srcDataIndex + 1);
} else if(this.srcDataIndex < destDataIndex) {
console.log("this.srcTableIndex < destIndex");
this.dataTable.deleteRow(this.srcDataIndex);
- this.dataTable.addRow(srcData, destDataIndex - 1);
+ this.dataTable.addRow(srcData, destDataIndex - 1, destTableIndex - 1);
}
else {
console.log("nothing to see here");
Please sign in to comment.
Something went wrong with that request. Please try again.