Hi-
I'm using the Q1 RC for Ajax context menu, populated via web service, in an Ajaxified page. I have noticed that upon each postback, the (generated) field "RadContextMenu1_ClientState" grows a little larger each time, even if the user never opened the context menu. My app uses the context menu with no static root menu, based upon the example code posted by Telerik a while back.
After a number of postbacks, the field will look like this:
RadContextMenu1_ClientState, size 115 = {"logEntries":[{"Type":3},{"Type":3},{"Type":3},{"Type":3},{"Type":3},{"Type":3},{"Type":3},{"Type":3},{"Type":3}]}
I need the menu to be re-created via the webservice after every postback, because its state and contents change. I do NOT include the context menu in the list of updated controls in the Ajax Manager. Why? Because even though all I'm doing in the .cs file is removing all the menu items, downloading the empty menu adds about 1.1K to my pagesize. Therefore, I manually clear out all the menu items during the Ajax Manager handler, onResponseEnd:
var menu = GetRadContextMenu();
if (menu.get_persistLoadOnDemandItems())
{
menu.trackChanges();
menu.get_items().clear();
menu.commitChanges();
menu._itemsLoaded = false;
}
If I try to clean up the menu in the menu's item close handler, it interferes with my handling of the actual menu item click. The menu works fine in this way EXCEPT that the Client State field just grows and grows by the "{"Type":3}" on each postback.
I could see no way to control this, except to add a hack to explicitly blank out the value in onResponseEnd():
form1.RadContextMenu1_ClientState.value = "";
Telerik, can you explain what's going on? Am I doing something totally wrong here?
Many thanks..
I'm using the Q1 RC for Ajax context menu, populated via web service, in an Ajaxified page. I have noticed that upon each postback, the (generated) field "RadContextMenu1_ClientState" grows a little larger each time, even if the user never opened the context menu. My app uses the context menu with no static root menu, based upon the example code posted by Telerik a while back.
After a number of postbacks, the field will look like this:
RadContextMenu1_ClientState, size 115 = {"logEntries":[{"Type":3},{"Type":3},{"Type":3},{"Type":3},{"Type":3},{"Type":3},{"Type":3},{"Type":3},{"Type":3}]}
I need the menu to be re-created via the webservice after every postback, because its state and contents change. I do NOT include the context menu in the list of updated controls in the Ajax Manager. Why? Because even though all I'm doing in the .cs file is removing all the menu items, downloading the empty menu adds about 1.1K to my pagesize. Therefore, I manually clear out all the menu items during the Ajax Manager handler, onResponseEnd:
var menu = GetRadContextMenu();
if (menu.get_persistLoadOnDemandItems())
{
menu.trackChanges();
menu.get_items().clear();
menu.commitChanges();
menu._itemsLoaded = false;
}
If I try to clean up the menu in the menu's item close handler, it interferes with my handling of the actual menu item click. The menu works fine in this way EXCEPT that the Client State field just grows and grows by the "{"Type":3}" on each postback.
I could see no way to control this, except to add a hack to explicitly blank out the value in onResponseEnd():
form1.RadContextMenu1_ClientState.value = "";
Telerik, can you explain what's going on? Am I doing something totally wrong here?
Many thanks..