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
3.5 / Cell editing and calendar intergration
29/07/2009
04:43
Avatar
glemarie
France
Member
Members
Forum Posts: 66
Member Since:
19/12/2008
sp_UserOfflineSmall Offline

Hi,

I'm trying to integrate UI datepicker in celledit mode, but Imust admit that its not a success Cry

In fact, I used the 3.5 example (http://www.trirand.com/jqgrid3.....qgrid.html, row edit mode).

I replaced the onSelectRow event with a beforeEditCell (with the correct parameters).

The pickdates function is correctly called, the input ID is correct, but nothing happens. I suppose that when the event is fired, the input element is not created yet ?

Is there a solution to my problem ?

Thanks

--------

Edit : I saw this post telling that it's the same thing than in row edit mode, but... I tried and the onSelectRow event was never fired (except when multiselect was active and even then, I had to click on the checkbox to fire the event)

05/08/2009
03:19
Avatar
glemarie
France
Member
Members
Forum Posts: 66
Member Since:
19/12/2008
sp_UserOfflineSmall Offline

Nobody can help me ?

05/08/2009
03:34
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Did you read the docs?

Also use dataInit event. See common configuration in editing

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.

05/08/2009
04:30
Avatar
glemarie
France
Member
Members
Forum Posts: 66
Member Since:
19/12/2008
sp_UserOfflineSmall Offline

Yes I read the docs (cell/row editting) + the example, but didn't see the dataInit function.

I just tried, but it seems the function is not called… See my code ('Date' field is the first one)

            grid7.jqGrid({
                url:'fraisForm.php?action=contentFrais',
                datatype: “json”,
                colNames:['Date', 'Commentaire', 'Hotel', 'Bar', 'Total'],
                colModel:[
                    {name:'Date',index:'Date', width:70, sortable:false, search: false, editable: true,editrules:{date:true, minValue:0}, datefmt:'d/m/Y', dataInit: function (elem) {$(elem).datepicker({dateFormat:"dd/mm/yy"});}},
                    {name:'Commentaire',index:'Commentaire', width:200, align:"left", sortable:false, search: false,editable: true,edittype:"textarea", editoptions:{rows:"3",cols:"40"}},
                    {name:'Hotel',index:'Hotel', align:"center", width:70, editable: true,editrules:{number:true, minValue:0}, sortable:false, search: false},
                    {name:'Bar',index:'Bar', align:"center", width:70, editable: true,editrules:{number:true, minValue:0},sortable:false, search: false},
                    {name:'Total',index:'Total', width:60, align:"center", editable: false,sortable:false, search: false}
                ],
                cellEdit: true,
                cellurl: “fraisUpdate.php?idSalarie=2&mois=7&annee=2009″,
                beforeSaveCell: function(rowid, cellname, value, iRow, iCol) {
                    …..
                },
                afterSaveCell: function(rowid, cellname, value, iRow, iCol) {
                    …..
                }
            });

05/08/2009
04:59
Avatar
glemarie
France
Member
Members
Forum Posts: 66
Member Since:
19/12/2008
sp_UserOfflineSmall Offline

I also tried with a simplier colmodel :

{name:'Date',index:'Date', search: false, editable: true, dataInit: function (elem) {$(elem).datepicker();}},

But nothing happens. I tried to display an "alert" in the dataInit function, but it never displays.

I really don't see why...

05/08/2009
05:09
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

{name:'Date',index:'Date', width:70, sortable:false, search: false, editable: true,editrules:{date:true, minValue:0}, datefmt:'d/m/Y',

editoptions:{dataInit: function (elem) {$(elem).datepicker({dateFormat:"dd/mm/yy"});} } },

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.

05/08/2009
05:12
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

05/08/2009
08:34
Avatar
glemarie
France
Member
Members
Forum Posts: 66
Member Since:
19/12/2008
sp_UserOfflineSmall Offline

Thanks tony it works. Shame on me, I didn't pay enought attention to the docs Embarassed

05/09/2009
06:11
Avatar
RobGMiller
Guest
Guests

When a datepicker is added to a column in a grid the column generates errors:

colModel date field entry:

{label: 'Date Added', name: 'DateAdded', index: 'DateAdded', width: 80,

   sortable: false,

   search: false,

   edittype: 'text',

   editable: true,

   editrules: { date: true, minValue: 0 }, datefmt: 'dd-mmm-yyyy', 

   editoptions: { dataInit: function(elem) { $(elem).datepicker({ dateFormat: 'dd-mmm-yyyy' }); } }

},

-When the grid first starts it goes through $.fn.datepicker but doesn't go through _attachDatepicker: (ui.datepicker.js)

-When the dateAdded column is clicked on it goes through $.fn.datepicker and does go through _attachDatepicker: and generates an error.

-The next time it is clicked on it doesn't go throught _attachDatepicker. It tryes to split the value  of the DateAdded field but the value is found to be empty even though there is something in it and it generates an error at grid.base.js line 1465.

             -grid.common.js.function checkDate line 274 date = date.split(sep);

-Without editoptions: { dataInit: function(elem) { $(elem).datepicker({ dateFormat: 'dd-mmm-yyyy' }); } } in the data field colModel entry there is no error when the column is clicked 

-the content of the field is filled via json from server as the grid opens and is "03-sep-2009".

Perhaps someone has encoutered this issue in the past and can indicate what I am doing wrong. 

08/09/2009
09:26
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Could you please give a link to the problem or if this is not possible send the configuration to me in order to test.

Thanks

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