Form : load data for several time error

Hi,

I have a form at the layout. LHS is combo for select the data, RHS is the form of checkbox, When I select the combo at first time, RHS can display the record of clicked checkbox from database. But when I select the combo at the second time or several time, it can not display new one record of clicked checkbox. Could you tell me what problem is or my syntax error.

cells(“a”)

[code]userSecurityFormA = myLayout.cells(“a”).attachForm(userSecurityFormDataA);
userSecurityFormA.getCombo(“user_id”).load(“php/userSecurityFormDataA.php”);

userSecurityFormA.attachEvent("onChange", function (name, value){
	if(name=="user_id"){			
	   	userSecurityFormA.load("php/userSecurityFormDataA_2.php?id="+value);
	   	
		dhtmlxAjax.get("php/getUsername.php?user_id="+value, function(r){
		   r = r.xmlDoc.responseXML; // will give you DOM object
		        //console.log(r.firstChild.tagName);
		       
		        var response = r.firstChild.childNodes[0].nodeValue;
		        userSecurityFormDataB(response);
		});[/code]

cells(“b”)

[code]function userSecurityFormDataB(response) {

userSecurityFormDataB = myLayout.cells("b").attachForm();
userSecurityFormDataB.load("php/userSecurityFormDataB.php?username="+response);

userSecurityFormDataB.attachEvent("onBeforeChange", function(id, value, checked, type){
   myLayout.cells("c").expand();
	myTree = myLayout.cells("c").attachTree();
	myTree.setImagePath("dht/skins/web/imgs/dhxtree_web/");
	myTree.enableCheckBoxes(1);
	myTree.enableThreeStateCheckboxes(true);
   if (type == "label") {
      // label click
      myTree.load("php/menuTree.php?itemName="+id+"&username="+response);
      return false;
   }
   return true;
});

userSecurityFormDataB.attachEvent("onChange", function(name,value,is_checked){
	//myLayout.cells("c").expand();
	myTree = myLayout.cells("c").attachTree();
	myTree.setImagePath("dht/skins/web/imgs/dhxtree_web/");
	myTree.enableCheckBoxes(1);
	myTree.enableThreeStateCheckboxes(true);
	if(is_checked){			
		myTree.load("php/menuTree.php?itemName="+name+"&username="+response);
		//alert(response);
		getSubString(response);
	}
});

}[/code]

thanks for your help.
Kenneth

Hi

Could you please provide us complete demo including all correspondnig js/css files?
Please also add information regarding current and expected behaviour.

Here is a small guide how to make a complete demo:
docs.dhtmlx.com/tutorials__auxil … pport.html

If you don’t want to share your demo here for any reasons - you can send it to support@dhtmlx.com, if so - please include link to this forum topic.

If you’re using PRO Edition please send your demo to support@dhtmlx.com

Hi ,

Thank you for your reply.

I don’t mind to share my project. Here is the complete demo, it include sql and complete js and css. I use the mysql and php. Please change UM2\php\config\config.php for the database login and password.Please find the attachment as below.

many thanks again.

Kenneth

Hi
Please do no attach PRO version on forum.
Your issue in progress, please, wait

Got the demo.
Please add information regarding current and expected behaviour.

Hi,

I am sorry to inform how to delect the attachment. After I will question to your support team.
When I select the combo of username at LHS. The middle place will display that I saves checkbox record in db. The first time can display it. When I select the combo of username at second time. It cannot show me the other one username’s information of checkbox.
I hope that when I select combo of username, it can show me different information of user.

Many thanks again.
Kenneth

I got:
TypeError: userSecurityFormDataB is not a function

Hi,

What’s mean. I write that it is a function.

Thanks for you help.
Kenneth

Could you give me the correct method.

function userSecurityFormDataB(response) { userSecurityFormDataB = myLayout.cells("b").attachForm();

userSecurityFormDataB is a function until first call, but after - it is dhtmlXForm instance.

How to change the correct code,
Many thanks
Kenneth

if userSecurityFormDataB() is not a function.
how to pass the user name from userSecurityFormA() to userSecurityFormDataB().

Many thanks.
Kenneth

Hi ,

I can load the data in the middle side at second time, But it can include the first time record. so, it will display the duplicate record at second time, Could you tell me which method can delete the data when load data at second time before.

thank you.
Kenneth Cho

Dear Kenneth,

This is DHTMLX support forum and we’re giving tips related to our Library here.

We do not teach programming - there are lots of resources in internet available for this.

If you need to hire our team to help you with your app - please contact our sales dept at sales@dhtmlx.com. Thank you.