Show Posts
|
Pages: [1] 2
|
2
|
General Category / EasyUI for jQuery / Re: Saving into multiple table
|
on: November 03, 2015, 09:24:54 AM
|
Hi, The simplest answer is a mysqli multi-line query: $conn = new mysqli('host','user','pword','DB');
$sql = <<<EOT insert into personalinfo(firstname,lastname) values('$firstname','$lastname'); insert into address(phone,email) values('$phone','$email'); EOT;
$result = $conn->multi_query($sql)
You would be much better off using stored procedures to do this as that is much safer.
|
|
|
5
|
General Category / EasyUI for jQuery / Update Context Menu per row [Resolved]
|
on: August 18, 2015, 06:37:46 AM
|
Hi, I'm trying to change the Text on a context menu depending upon which row you click on. There seem to be two ways to achieve this, neither of which I am able to correctly run. The first using the set text method on the menu: http://jsfiddle.net/3L4ej4dx/100/As the menu items are created dynamically, I am unable to find them by name or id. The alternative method is to destroy the original menu once it's been shown and create a new one each time the menu is triggered: http://jsfiddle.net/3L4ej4dx/99/ This throws an error jquery.easyui.min.js:5453 Uncaught TypeError: Cannot read property 'options' of undefined Any suggestions, ideas, insightful knowledgeable answers will all be gratefully received. Thank you.
|
|
|
9
|
General Category / EasyUI for jQuery / Re: cell-editing: how to get the new value, field and key value
|
on: August 12, 2015, 01:09:23 PM
|
Hi, I've managed to cobble together a solution which meets my needs. // var dgdata is defined outside of this code block and represents all the data in // the datagrid. For more details see: http://www.jeasyui.com/forum/index.php?topic=5124.0
// Set up a variable to hold editable state var scCell = function(){ this.index this.field this.value }
//create the editable state variable var Clickc = new scCell
dgrid.datagrid({onCellEdit:function(index,field,value){ var ed = dgrid.datagrid('getEditor', {index:index,field:field}); if (ed){ Clickc.index = index; // get the row that was clicked
Clickc.field = field; // get the field which was clicked
Clickc.value = $(ed.target).val(); //Get cell current value } }, onEndEdit:function(index){ var ed = dgrid.datagrid('getEditor', {index:index,field:Clickc.field}); if (ed){ if (typeof dgdata.rows[index].pkey === "undefined") {alert('TODO Insert PHP Needed!'),dgrid.datagrid('reload')} else {alert(dgdata.rows[index].pkey);} } } });
The index variable can be used in conjunction with the pkey field to get the row primary key. The test (typeof dgdata.rows[index].s1_key === "undefined") is used to determine when a new has been added. Then the insert function must be called and the datagrid reloaded. Any feedback would be more than welcome. I'm sure there must be a better way to do this. Thanks.
|
|
|
11
|
General Category / EasyUI for jQuery / cell-editing: how to get the new value, field and key value [Resolved]
|
on: August 11, 2015, 09:38:46 AM
|
Hi, My datagrid is formed in the manner as below. Using the cell editing extension I'm trying to get the new values of changed cells, their field names and the primary key value. The primary key is provided by the get-table.php but is not displayed in the datagrid. var dgrid = $('#table'); dgrid.datagrid({ title: 'Datagrid', singleSelect: true, width: '80%', url: get-table.php, columns:[[ {field:'itemid',title:'Item ID',width:'15%', editor:{ type:'combobox', options:{ valueField:'Vol', textField:'Vol', data: items, required: true } } }, {field:'productid',title:'Product',width:'15%',align:'center',editor:'text'}, {field:'listprice',title:'ListPrice',width:'15%',align:'center',editor:'numberbox'} ]] });
dgrid.datagrid('enableCellEditing').datagrid('gotoCell', { index: 0, field: 'productid' }); }
|
|
|
13
|
General Category / EasyUI for jQuery / editor column combobox events [Resolved]
|
on: August 10, 2015, 01:08:00 PM
|
Hi, Please see: http://jsfiddle.net/3L4ej4dx/83/This is clearly wrong. My objective is to swap the current value and selected values. Initially though, this question is dealing with how to capture the combobox select even from the editor. I also need to get the current index of the active row. I am missing something quite substantial as I'm finding it difficult to related the documentation for regular controls to datagrid editors, as with the combobox above.
|
|
|
15
|
General Category / EasyUI for jQuery / editor column combobox empty optional values [Resolved]
|
on: August 09, 2015, 11:16:46 AM
|
Hi,
Please see this example. http://jsfiddle.net/3L4ej4dx/81/
When clicked there are no options available to choose from in the combo box in the window.
In reality, the data is loaded from a database. The for-loop run on the On-Load-Success event is equivalent to how the data is loaded in the application. How can the combobox have it's options updated post load?
|
|
|
|