Forum

November 2nd, 2014
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_Related Related Topics sp_TopicIcon
beforeSaveCell is not using returned value
05/10/2010
22:19
Avatar
jhonnycano
New Member
Members
Forum Posts: 1
Member Since:
05/10/2010
sp_UserOfflineSmall Offline

Hello. I'm trying to affect the edited data to multiply it, so if user writes 10, at the grid should have been saved 10000.

From documentation:

applies only to a cell that is editable; this event fires before validation of values if any. This event can return the new value which value can replace the edited one
beforeSaveCell : function(rowid,celname,value,iRow,iCol) {
if( some_condition )
{ return "new value"; }
}
The value will be replaced with "new value"

What am I missing? here is my code. Thanks in advance. I'm using 3.7.2

var myGrid = $("#myHtmlTag").jqGrid({
                data: arrOfData,
                datatype: 'local',
                colNames: ['Inicio', 'Fin', 'Contrato', 'Valor'],
                colModel: [
      { name: 'fch_inicio', index: 'fch_inicio', width: 155, sortable: false, sorttype: 'date', datefmt: 'Y-m-d' },
      { name: 'fch_fin', index: 'fch_fin', width: 155, sortable: false, sorttype: 'date', datefmt: 'Y-m-d' },
      { name: 'contrato', index: 'contrato', width: 90, sortable: false },
      { name: 'vr_proyectado', index: 'vr_proyectado', width: 80, align: 'right', sorttype: 'float', sortable: false, editable: true, edittype: 'text' },
    ],
                cellEdit: true,
                cellsubmit: 'clientArray',
                beforeSaveCell: function (rowid, cellname, value, iRow, iCol) {
                    var multiplica = 1000;
                    return value * multiplica;

                },
                pager: '#pager',
                rowNum: 20,
                rowList: [10, 20, 30],
                sortname: 'contrato',
                sortorder: 'desc',
                viewrecords: true,
                caption: 'Caption'
            });

06/10/2010
08:06
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks.

There is a bug. Fixed in GitHub.

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: 715

Currently Online:
40 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