PDA

View Full Version : [CLOSED] TreePanel and CommitChanges();



ADV
May 13, 2016, 9:03 AM
Hi,

I am seeing that there is no CommitChanges () method for Treestore (TreePanel).

I need to remove the Mark (red), server side after an update.

Is there a way to do this ?

Alessandro

fabricio.murta
May 13, 2016, 1:58 PM
Hello! It seems ExtJS down to 4 series (which are part of Ext.NET 2 series) didn't contain the commitChanges() method at all.

I am afraid for version 2 we are limited to committing the individual nodes one by one.

About the next versions, this is and is not the case. Seems we didn't port the CommitChanges() methods to the 'code behind' version although it works on the JavaScript side on versions 3 and 4 of Ext.NET.

Well, but if you are sticking to 2.x, you still can do it if you call each nodes' commit() like explained here: Accept Changes Treepanel store (http://forums.ext.net/showthread.php?23279)

fabricio.murta
May 13, 2016, 2:07 PM
And, hello again!

We have created issue #1332 (https://github.com/extnet/Ext.NET/issues/1332) to add the mapping to Ext.NET 3 and 4 series (as that's all that's missing to those versions), but unfortunately it is a feature completely absent from the 2 series and it should be treated as a new feature and implemented from scratch.

You can try and get the sources from ExtJS 5+ to extract the code if you feel like trying to backport this to ExtJS 4, but we can't guarantee it will work. The code can be found here: http://docs.sencha.com/extjs/5.1/5.1.2-apidocs/#!/api/Ext.data.TreeStore-method-commitChanges (hover the mouse over the method, then click 'view source' to the right).

ADV
May 13, 2016, 5:00 PM
Hello, thanks for the answers.

I solved this way.



[DirectMethod(Namespace = "CompanyX")]
public void EditAssessment(int id, string field, string oldValue, string newValue, object recordData)
{
if (updateRecordAssessment(id, field, newValue))
TreePanelAssessment.GetNodeById(id).Commit();
}


Ale

fabricio.murta
May 16, 2016, 2:58 PM
Hello! Thanks for sharing your solution! That really looks nicer than re-writing the whole commitChanges() code from 5.x!