+2007-07-24 Igor Zelmanovich <igorz@mainsoft.com>
+
+ * TreeView.cs: refactoring:
+ * TreeView.js:
+ used ClientScriptManager.GetCallbackEventReference API instead calling
+ WebForm_DoCallback explicit.
+
2007-07-15 Igor Zelmanovich <igorz@mainsoft.com>
* BaseValidator.cs: for NET_2_0: fixed client side validation.
string ctree = ClientID + "_data";
string script = string.Format ("var {0} = new Object ();\n", ctree);
+ script += string.Format ("{0}.treeId = {1};\n", ctree, ClientScriptManager.GetScriptLiteral (ClientID));
script += string.Format ("{0}.uid = {1};\n", ctree, ClientScriptManager.GetScriptLiteral (UniqueID));
script += string.Format ("{0}.showImage = {1};\n", ctree, ClientScriptManager.GetScriptLiteral (ShowExpandCollapse));
if (Page != null) {
script += string.Format ("{0}.form = {1};\n", ctree, Page.theForm);
+ script += string.Format ("{0}.PopulateNode = function(nodeId) {{ {1}; }};\n", ctree, Page.ClientScript.GetCallbackEventReference ("this.uid", "nodeId", "TreeView_PopulateCallback", "this.treeId + \" \" + nodeId", "TreeView_PopulateCallback", false));
script += string.Format ("{0}.populateFromClient = {1};\n", ctree, ClientScriptManager.GetScriptLiteral (PopulateNodesFromClient));
script += string.Format ("{0}.expandAlt = {1};\n", ctree, ClientScriptManager.GetScriptLiteral (GetNodeImageToolTip (true, null)));
script += string.Format ("{0}.collapseAlt = {1};\n", ctree, ClientScriptManager.GetScriptLiteral (GetNodeImageToolTip (false, null)));
var expand = node.style.display == "none";
if (tree.populateFromClient && expand && node.populated != true && (node.innerHTML.length == 0 || node.hasError)) {
- WebForm_DoCallback (tree.uid, nodeId, TreeView_PopulateCallback, treeId + " " + nodeId, TreeView_PopulateCallback, false, tree.form)
+ tree.PopulateNode (nodeId);
return;
}
-2007-07-28 Igor Zelmanovich <igorz@mainsoft.com>
+2007-07-24 Igor Zelmanovich <igorz@mainsoft.com>
+
+ * ClientScriptManager.cs: fixed: GetCallbackEventReference method.
+
+2007-07-23 Igor Zelmanovich <igorz@mainsoft.com>
* Page.cs: refactoring: __doPostBack client script
It is a part of adapting System.Web to work whith
if(!(control is ICallbackEventHandler))
throw new InvalidOperationException ("The control must implement the ICallbackEventHandler interface and provide a RaiseCallbackEvent method.");
- return GetCallbackEventReference (control.UniqueID, argument, clientCallback, context, clientErrorCallback, useAsync);
+ return GetCallbackEventReference ("'" + control.UniqueID + "'", argument, clientCallback, context, clientErrorCallback, useAsync);
}
public string GetCallbackEventReference (string target, string argument, string clientCallback, string context, string clientErrorCallback, bool useAsync)
{
RegisterWebFormClientScript ();
- return string.Format ("WebForm_DoCallback('{0}',{1},{2},{3},{4},{5},{6})", target, argument, clientCallback, context, ((clientErrorCallback == null) ? "null" : clientErrorCallback), (useAsync ? "true" : "false"), page.theForm);
+ return string.Format ("WebForm_DoCallback({0},{1},{2},{3},{4},{5},{6})", target, argument, clientCallback, context, ((clientErrorCallback == null) ? "null" : clientErrorCallback), (useAsync ? "true" : "false"), page.theForm);
}
#endif