Opened 11 years ago

Closed 11 years ago

#7012 closed defect (duplicate)

dojox.grid.DataGrid grid.removeSelectedRows() didn't work

Reported by: guest Owned by: Bryan Forbes
Priority: high Milestone: 1.2
Component: DojoX Grid Version: 1.1.1
Keywords: DataGrid Cc:
Blocked By: Blocking:

Description

it throw out a Error:this._assert is not a Function

I change the dojo.forEach of removeSelectedRows,It works!

But when I remove the row from the top(maybe twice or third),the row still there,and the value change to all "..."

change from:

	removeSelectedRows: function(){
		// summary:
		//		Remove the selected rows from the grid.
		if(this._canEdit){
			this.edit.apply();
			var items = this.selection.getSelected();
			if(items.length){
				dojo.forEach(items, this.store.deleteItem);
				this.selection.clear();
			}
		}
	}

to:

	removeSelectedRows: function(){
		// summary:
		//		Remove the selected rows from the grid.
		if(this._canEdit){
			this.edit.apply();
			var items = this.selection.getSelected();
			if(items.length){
				dojo.forEach(items, this.store.deleteItem,this.store);
				this.selection.clear();
			}
		}
	}

Change History (2)

comment:1 in reply to:  description Changed 11 years ago by guest

I found the solution:

chang to this,It is Ok!

	_onDelete: function(item){
		var idx = this._getItemIndex(item, true);

		if(idx >= 0){
			//this._rows.splice(idx, 1);
			this._rows.splice(dojo.indexOf(this._rows, idx),1);
		}

		delete this._identity_map[this.store.getIdentity(item)];

		this.updateRowCount(this.rowCount-1);
	},

comment:2 Changed 11 years ago by Bryan Forbes

Resolution: duplicate
Status: newclosed

duplicate of #6853

Note: See TracTickets for help on using tickets.