EasyUI Forum
September 14, 2025, 03:24:26 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1] 2
1  General Category / EasyUI for jQuery / Re: Custom menuItem in Datagrid Context Menu on: November 04, 2015, 09:07:47 AM
Thank you, that has worked.

Awesome!   Cheesy
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:

Code:

$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.
3  General Category / EasyUI for jQuery / Custom menuItem in Datagrid Context Menu [Solved] on: November 03, 2015, 07:48:05 AM
Hi there,

Jfiddle: http://jsfiddle.net/3L4ej4dx/166/

I am trying to recreate the custom menu item of the below example but on a datagrid:
http://www.jeasyui.com/demo/main/index.php?plugin=Menu&theme=default&dir=ltr&pitem=

This is in fact two questions almost cunningly disguised as one.  The first is that in the jfiddle page as in page, when you click on the textbox in the menu, it disappears and can not been edited.  How do I edit this text box?

The second, is once edited, how do refer to the submitted value, to post it?

Thanks.
4  General Category / EasyUI for jQuery / Re: Update Context Menu per row on: August 18, 2015, 08:13:06 AM
Thank you, that has worked splendidly.  Smiley

Awesome!!!
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.
6  General Category / EasyUI for jQuery / Re: Using Validate Type in an editable Datagird on: August 13, 2015, 12:30:41 PM
The final issue to remain was to extend the validation.

This turned out to be a question of where the extension code block was placed.  When at the beginning of the code it did not register.  Preceding the function did the trick.

Please see this jfiddle for a working example: http://jsfiddle.net/3L4ej4dx/90/
7  General Category / EasyUI for jQuery / Re: Using Validate Type in an editable Datagird on: August 13, 2015, 11:16:29 AM
Hi,

In this example the validType is picked up.  All that remains is for the correct evaluation of the SHA1 type.

http://jsfiddle.net/3L4ej4dx/88/

To pick up the validate type the column is described as follows:
Code:
{field:'SHA1',title:'HASH Code',width:'10%',align:'center',editor:{type:'textbox',options:{validType:'SHA1'}}}

It all comes down to the curly braces you see.
8  General Category / EasyUI for jQuery / Re: Using Validate Type in an editable Datagird on: August 12, 2015, 01:11:56 PM
The issue seems to be that no matter how the validatebox property is defined, I can not get it to trigger validation.
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.

Code:

// 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.
10  General Category / EasyUI for jQuery / Using Validate Type in an editable Datagird [Resolved] on: August 11, 2015, 12:39:25 PM
Hi,

I'd like to check for SHA1 hashes.


Please this example:  http://jsfiddle.net/3L4ej4dx/87/

Ideally, the rule would be follow the regular expression form [0-9a-fA-F]{40,40}



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.


Code:
    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'
            });
      }
12  General Category / EasyUI for jQuery / Re: editor column combobox events on: August 11, 2015, 08:27:28 AM
Thanks!

That's awesome!
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.
14  General Category / EasyUI for jQuery / Re: editor column combobox empty optional values on: August 10, 2015, 10:45:23 AM
Hi,

Thank you, that is awesome! 
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?
Pages: [1] 2
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!