Title: onClickRow to generate a side panel form Post by: wolfnbasti on July 14, 2014, 02:52:56 PM Hello - I'm trying to click a name from a row in single column datagrid, located on the left side of my site, and then have it generate a form on the right side that loads several data items regarding the name clicked. The idea is to list all the account information about the name selected on the right side of the grid column. I can load and populate the data from the DB and display it and design the form, etc., but I just can't seem to get the form to appear when the name is clicked from the column.
Any ideas how I might do this? Do I need to move outside of onClickRow to generate the form? Thanks. Title: Re: onClickRow to generate a side panel form Post by: jarry on July 14, 2014, 03:35:30 PM How do you generate form code when click a datagrid row. You may need to show some code to demonstrate your issue.
Title: Re: onClickRow to generate a side panel form Post by: wolfnbasti on July 14, 2014, 04:17:34 PM I'm not sure I understand what you are asking.
This is how I'm capturing data from my db based on a row click: var attributeDefs; var resourceDef; var resources; var attributeValues; var attributeIds; $(function(){ $('#RN').datagrid({ onClickRow: function(index,row){ editIndex = index; rowEdit = JSON.parse(JSON.stringify($('#RN').datagrid('getRows',editIndex))); var editResourceName = rowEdit[editIndex].resourceName; var editResourceId = rowEdit[editIndex].resourceId; $.ajax({ url: baseUrl + '/clients/' .... /attributes', type: "GET", }).done(function(data) { attributeDefs = data.attributeDefs; resourceDef = data.resourceDef; resources = data.resources; attributeValues = data.attributes.values; attributeIds = data.attributes.ids; window.alert("resourceDef: " + resourceDef + " attributeValues: " + attributeValues); }); } }); }); I was thinking there might be some way to use "Load Form Data" ( SEE: http://www.jeasyui.com/demo/main/index.php?plugin=Form&theme=default&dir=ltr&pitem= (http://www.jeasyui.com/demo/main/index.php?plugin=Form&theme=default&dir=ltr&pitem=)) to populate a form when a user clicks a row in the grid. But I haven't had any luck. Title: Re: onClickRow to generate a side panel form Post by: jarry on July 14, 2014, 05:07:13 PM Suppose that you have a form in your page.
Code: <form id="ff" ...> Code: $('#RN').datagrid({ |