Saving TreeGrid data

TreeGrid:

isc.TreeGrid.create({
	ID: "SafetyRulesTree",
	autoDraw:false,
	dataSource: "SafetyRules",
	autoFetchData: false,
	leaveScrollbarGap: false,
	alternateRecordStyles: true,
	nodeClick: "frmSafetyRule.editRecord(node);",
	nodeContextClick: function ()
	{return customNodeMenu.showContextMenu();
	},
	loadDataOnDemand:false

Dynamic Form:

isc.DynamicForm.create({
    ID: "frmSafetyRule",
    dataSource: "SafetyRules",
    width:300,
    autoDraw:false,
    numCols: 2,
    colWidths: ["47%", "*"],
    fields:[
    {name: "relation", title: "Rule #", type: "text", width: 100, canEdit: false},
	    {name: "name", title: "Rule Title", type: "text", width: 500},
	    {name: "description", title: "Rule Desription", type: "text", width: 500, height: 400, length: 500}
	]
});

Button:

btnSave = isc.IButton.create({
name: "Save", 
title: "Save Rule", 
type: "button",
click:function () 
{
	if (frmSafetyRule.valuesHaveChanged())
		frmSafetyRule.saveData();
});

I am using above to modify and save TreeGrid data.
When I click on a push button then (after a while) Browser says that script is taking too long and if I want to stop it.
What is a design pattern of saving TreeGrid data?

Thanks

Hi Mark,
The approach in your code looks fine, and I was unable to reproduce your issue by tweaking this code to run against the standard “employees” dataSource in the SDK package.
The quickest way for us to get to the bottom of this would be if you could send us a complete standalone example that demonstrates the problem.
Alternatively, some things that might help us see what’s going on are:

1: Can you show us your dataSource definition?
2: What browser are you seeing the bug on?
3: Can you try causing the error in Internet Explorer, open the Developer Console, and send us the entire contents of it, including the long stack trace caused by the infinite recursion error.
4: Are you seeing any errors in the server side logs? Can you send us anything that looks relevant?

Note: We have a new debugging topic in the 5.7.1 documentation which outlines the best way to report errors like this. Check it out here

Thanks
Isomorphic Software

Here is my quick respond. Let’s see if you can use this minimum of information.

isc.DataSource.create({
		ID:"SafetyRules",
		dataURL:"../../safety/forms/safety.asp?requesttype=send&datarequest=xml&methodexecute=mBuildMenuTree",
		recordXPath:"//menu",
		fields:[
		        {type:"integer", required:true, title:"Menu ID", primaryKey:true, name:"menuid"},
		        {type:"integer", required:true, title:"Menu system", rootValue:"1", foreignKey:"menu.menuid",name:"parentid"},
   		        {type:"text", title:"Name", length:128, name:"name"}
		    ]
});
  1. IE7
  2. Not sure how to do that.
  3. Will be looking into it.

On the developer console / stack trace
You can open the developer console by entering “javascript: isc.showConsole()” in the URL bar and hitting Enter.
The Developer console will open in a new window.
The “results” text area contains various logs for debugging your application. If you’re in IE, and you’ve encountered a Javascript error (including an “infinite recursion”), the log will include a stack trace – this shows the code execution thread that tripped the error.
You can also enable “Info” or “Debug” level logging for various categories via the “logging preferences” menu. In this case, it might be worth setting “XMLComm”, “RPCManager” and “DataSource” to info level logging [note you can use the “more…” entry to if you don’t see any of these in the menu directly].

We’ll take a look at the datasource definition and see if it helps us understand what’s going on in your case, but ultimately a standalone test case that demonstrates the problem makes debugging a huge amount easier on our end as we can see exactly what’s going on in a controlled environment.

Thanks
Isomorphic Software Support

I will definetely try to put a sample together.