Forum

July 12th, 2025
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Show input field in Cell Edit
08/01/2010
16:45
Avatar
AdaXi
Guest
Guests

Hi everyone !

I am trying to do a editable jqGrid using 'Cell Edit', I would like to show the input field immediately, whitout needing to click on the cell to show the input field. Is this possible ? If so, could you explain me how to do this ?

Thanks,

AdaXi

10/01/2010
12:51
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Try to use inline edit. Get all the id of the grid, then loop throught these with editRow method.

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

10/01/2010
16:41
Avatar
AdaXi
Guest
Guests

I will try that tomorrow, thanks for the advice !

AdaXi

EDIT: It worked great !

11/01/2010
20:11
Avatar
AdaXi
Guest
Guests

I need your help one more time, to solve an event related problem.

This is the code that I have now :

jQuery("#cart").jqGrid({
        url:        '<?php echo base_url().$this->lang->lang().'/basket/show/update'; ?>',
        datatype:    'xml',
        mtype:        'POST',
        height:    'auto',
        colNames:    ['Image','Name','Qty','Stock', 'HT','TTC'],    
        colModel :    [
            {
                name:'image',     
                index:'image',     
                width:100,  
                editable: false,   
                sortable: false,    
                align: 'center'
            },
            {
                name:'name',      
                index:'name',      
                width:200,  
                editable: false,   
                sortable: false
            }, 
            {
                name:'quantity',  
                index:'quantity',  
                width:55,   
                editable: true,    
                sortable: false,  
                align: 'center', editrules:{number:true}
            },
            {
                name:'stock',     
                index:'stock',     
                width:50,   
                editable: false,   
                sortable: false,  
                align: 'center'
            },
            {
                name:'wotax',     
                index:'wotax',     
                width:100,  
                editable: false,   
                sortable: false,    
                align: 'right',
                formatter:'currency',
                formatoptions: {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, suffix: " EUR"}
            },
            {
                name:'wtax',      
                index:'wtax',      
                width:100,  
                editable: false,   
                sortable: false,    
                align: 'right',
                formatter:'currency',
                formatoptions:{decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, suffix: " EUR"}}
        ],
        cellEdit:   true,
        cellsubmit: 'remote',
        cellurl:    '<?php echo base_url().$this->lang->lang().'/basket/edit' ?>',
        afterSaveCell: function(id, cellname, value, iRow, iCol) {
                alert('heya');
                jQuery("#cart").jqGrid('trigger', 'reloadGrid' );
        },
        gridComplete: function(xhd){
                var dataIDs = jQuery('#cart').getDataIDs();  
                for (var index in dataIDs) {
                    jQuery('#cart').editRow(dataIDs[index],false);
                }
        }
});

 I am trying to reload the grid after the user edits a cell, I am using afterSaveCell to do exactly that, but nothing happens, why ?

12/01/2010
18:13
Avatar
AdaXi
Guest
Guests

Updated the code, it should be correct according to the documentation.

This code is based in part in the code that is on the examples page : http://www.trirand.com/blog/jq.....qgrid.html , more precisely at "New in version 3.3 > Cell editing".

...

BUT, it's still not working !

I have another question regarding the example in the above page : in the source code they include the script grid.celledit.js, do we still need to included in the last version, or it's already included in the jquery.jqGrid.min.js version 3.6.

13/01/2010
18:48
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

You have a mixed cellEdit and inline edit - they can not exist together.

In case you use inline edit

http://www.trirand.com/jqgridw.....ne_editing

maybe you will need to use aftersavefunc

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 994

Currently Online:
505 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information