EasyUI Forum
April 29, 2024, 07:42:30 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Row Editing in DataGrid save function  (Read 8662 times)
dayaners
Newbie
*
Posts: 16


View Profile
« on: May 09, 2014, 10:01:38 AM »

Hello, im starting with easyui and
i would like to save the lines of editable datagrid.
I have this code for Row editing:
 
Code:
var editIndex = undefined;
        function endEditing(){
            if (editIndex == undefined){return true}
            if ($('#tt').datagrid('validateRow', editIndex)){
                var ed = $('#tt').datagrid('getEditor', {index:editIndex,field:'id'});
                var descricao = $(ed.target).combobox('getText');
                $('#tt').datagrid('getRows')[editIndex]['codmat'] = descricao;
                $('#tt').datagrid('endEdit', editIndex);
                editIndex = undefined;
                return true;
            } else {
                return false;
            }
        }
        function onDblClickRow(index){
            if (editIndex != index){
                if (endEditing()){
                    $('#tt').datagrid('selectRow', index)
                            .datagrid('beginEdit', index);
                    editIndex = index;
                } else {
                    $('#tt').datagrid('selectRow', editIndex);
                }
            }
        }

and must pass all the data to the php and db.
Someone can tell me how starts?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 09, 2014, 09:05:07 PM »

Using the edatagrid plugin may be more easily. Please refer to this example http://www.jeasyui.com/demo/main/index.php?plugin=Application&theme=default&dir=ltr&pitem=CRUD%20DataGrid.
Logged
dayaners
Newbie
*
Posts: 16


View Profile
« Reply #2 on: May 12, 2014, 06:04:40 AM »

thanks i will try this one
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!