jQuery UI Widgets › Forums › Angular › sync is not defined While setting cell value using setCellValue()
Tagged: angular treegrid, Sync issue, treegrid, typescript treegrid
This topic contains 5 replies, has 4 voices, and was last updated by Hristo 6 years, 11 months ago.
-
Author
-
October 16, 2017 at 10:52 am sync is not defined While setting cell value using setCellValue() #96713
Hi ,
i’m trying to set the tree grid cell value in side the Ajax call response using setCellValue() , but getting the sync error as shown below.sync is not defined
at b.(anonymous function).setCellValueByKey (https://www.jqwidgets.com/public/jqwidgets/jqx-all.js:62:106689)
at b.(anonymous function).setCellValue (https://www.jqwidgets.com/public/jqwidgets/jqx-all.js:186:865)
at Object.a.jqx.invoke (https://www.jqwidgets.com/public/jqwidgets/jqx-all.js:14:56927)
at Object.a.jqx.jqxWidgetProxy (https://www.jqwidgets.com/public/jqwidgets/jqx-all.js:14:61989)
at HTMLDivElement.<anonymous> (https://www.jqwidgets.com/public/jqwidgets/jqx-all.js:14:67906)
at Function.each (https://code.jquery.com/jquery-1.11.1.min.js:2:2973)
at m.fn.init.each (Details
updateRow: (rowID, rowData, commit) => {
this.myService.updateMyData(rowData) — this is an Ajax post call
.subscribe(
result => {
this.treeGrid.setCellValue(rowID,’time’, result.body.savedTimeStamp) — value will get from response object like
}}
—-
{
text: ‘Time Stamp’,
cellClassName: ‘businessAnalyst’,
dataField: ‘time’,
width: 240, cellsalign: ‘left’, align: ‘left’,
editable: false
}
—
{name: ‘time’, type: ‘string’}October 16, 2017 at 3:51 pm sync is not defined While setting cell value using setCellValue() #96733Hi
I am also facing the same issue. Without ajax call it works perfectly fine? Is there is a way we can put this inside ajax call and still have it working?
Thanks
RiteshOctober 17, 2017 at 8:14 am sync is not defined While setting cell value using setCellValue() #96744Hi Team,
Any suggestions on sync issue while setting the cell value after add/update row. ?
trying to set the saved time in one of the column in the grid on the current row which was added/updated
Kindly help.
Thanks
GopiOctober 17, 2017 at 8:35 am sync is not defined While setting cell value using setCellValue() #96746Hi Gyes,
Can some of you share a simple example of that?
Best Regards,
IvojQWidgets Team
http://www.jqwidgets.com/October 17, 2017 at 10:16 am sync is not defined While setting cell value using setCellValue() #96750Hi Ivo,
Below is the simplified version.
Here rowID -> rowKey of the grid row
rowData -> key value pair of grid rowupdateRow: (rowID, rowData, commit) => {
this.myUpdateData(rowData)
.subscribe(
result => {
if(result.status == 200) {
this.treeGrid.setCellValue(rowID,’name’, “”+result.body.name);
this.treeGrid.setCellValue(rowID,’timeStamp’, “”+result.body.timeStamp);
this.renderMessage(result,commit);} else {
// ERROR HANDLER
this.renderMessage(result,commit);
}
},
error => {
//commit(false);
//this.errorMessage = <any>error;
}
);
},myUpdateData(data: any): Observable<any> {
let body = JSON.stringify(data);
return this.http.post(environment.serverUrl + ‘myapp/save’, body, this.options)
.map((res: Response) => res.json())
.catch(this.handleError);
}renderMessage(result: any, commit:any): void {
if (result.status == 200) {
this.errorMessage = false;
this.successMessage = true;
commit(true);
} else {
this.errorMessage = true;
this.successMessage = false;
if(result.status == 409 || result.status == 400){
commit(true);
}else{
commit(false);
}}
this.message = result.message;
}Thanks
GopiOctober 19, 2017 at 11:08 am sync is not defined While setting cell value using setCellValue() #96815Hello,
This looks like the data binding is not correct.
I would suggest you try to create this AJAX request synchronized.Also, about the “setCellValue” I got this as an issue and I will create a work item for this.
Thank you for the feedback. I would like to suggest you try to useupdateRow
method to change the value of one particular cell.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.