Tuesday, November 16, 2010

Umbraco Consistency– (Jtree)

 

Today, Finally what happen on my Custom Tree State.
In some reason when in my custom tree, It forget about their state.

And After couple hours, I notice that it’s because I use Pascal Case on my application name. 

In some Umbraco.Tree it store the the state using lowercase whatever appname in database but when i loaded it used whatever the name in database.

Here is the screenshot

shiftApp: function (whichApp, appName) {
89 /// <summary>Changes the application</summary>
90
91 this._debug("shiftApp: " + whichApp + ", " + appName);
92
93 UmbClientMgr.mainTree().saveTreeState(this._currApp == "" ? "content" : this._currApp);
94
95 this._currApp = whichApp.toLowerCase();
96
97 if (this._currApp != 'media' && this._currApp != 'content' && this._currApp != 'member') {
98 jQuery("#buttonCreate").attr("disabled", "true");
99





The reason why I use Pascal Case instead of Camel Case because in .NET  I Store the appAlias and TreeAlias in Enum, So It seems good if I use Pascal Case for consistency.



I guess I need to put it back to Camel Case, otherwise I need to change UmbracoApplicationActions.js for this to work

No comments: