cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Advanced Grid - EditedTable Not Working

A_Macierzynski
15-Moonstone

Advanced Grid - EditedTable Not Working

Hi guys,

 

I am working with advanced grid from marketplace. After many tries I am not able to get any data from the EditedTable property.

 

Scope:

I have service which is providing dynamic data for my Ad.Grid. It has 1 editable checkbox column (btw. there is a wrong definition of editable column in official documentation. Will report it as an bug later)

 

this.handleRowEditsCallback = function (stage, rows) {
var editedRowsInfoTable = {
"dataShape": {
"fieldDefinitions": infoTableDataShape
},"rows": rows
};

if (thisWidget.getProperty("IsEditable", false) === true) {
if (stage === 0) {
thisWidget.jqElement.triggerHandler('EditCellStarted');
} else if (stage === 2) {
thisWidget.setProperty('EditedTable', editedRowsInfoTable);
thisWidget.jqElement.triggerHandler('EditCellCompleted');
}
}
};

 

And it is assing to the gridAdvanced def which is:

 

 

gridAdvanced.rowEditCallback = thisWidget.handleRowEditsCallback;

 

This function is not invoked at all. Widget events like:

  • EditCellStarted
  • EditCellCompleted

are not invoked as well.

 

Any ideas what I am doing wrong? Is this maybe a bug?

I am using ThingWorx 8.2.1.

 

Thanks,

Adam

1 REPLY 1

I debug it even more and found Event bounding definition which is:

 

this._gridAdvanced.attachEvent('onScroll', this._handleScrollEvent.bind(this));
this._gridAdvanced.attachEvent('onCellChanged', this._handleCellChangeEvent.bind(this));
this._gridAdvanced.attachEvent('onEditCell', this._handleEditCellEvent.bind(this));

 

Now the fun part is that if I debug all 3 handlers from above definition, only first on is catched.

Cell Changed & Edit Cell are not working.

 

Still have no idea if it is my fault or problem in code.

Tried every possible combination of checkbox.

 

In result I customized code. Added new ootb column which is checkbox with onCheck event:

this._gridAdvanced.attachEvent("onCheck", this._handleCheckboxChangeEvent.bind(this));

 

And this is working for me like a charm.

Would appriciate any help.

 

Best,

Adam

Announcements


Top Tags