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_TopicIcon
change select options for each row
27/05/2009
02:05
Avatar
jonhb
Member
Members
Forum Posts: 12
Member Since:
27/05/2009
sp_UserOfflineSmall Offline

Been searching the forum and found one suggestion to use the berforeSelectRow event but it does not work correctly.

beforeSelectRow: function(id){
  rowdata = $('#grid').getRowData(id);
  //alert(rowdata['value']);
  updateSubMilestone(rowdata['value']);
  return true;
}

function updateSubMilestone(val) {
// set options here based on val
jQuery('#grid').setColProp('field1', {editoptions: {value:options}});

}

It works to some extent, but it is one step behind, ie when I click a row it does not get populated until i click a new row! So the options are always for the previous row.

Are there any other events I could use?

28/05/2009
04:40
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Could you please post the rest of code where you edit the cell?

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.

02/06/2009
01:42
Avatar
jonhb
Member
Members
Forum Posts: 12
Member Since:
27/05/2009
sp_UserOfflineSmall Offline

Hi,

this is rest of the code:

                    var lastsel;
                    function checksave(result) {
                        if (result.status != 200) {
                            alert(result.statusText);
                            alert('Update failed!');
                            return false;
                        }
                        return true;
                    }

and event for grid:

                            onSelectRow: function(id){
                                if(id && id!==lastsel){
                                    jQuery('#grid').restoreRow(lastsel);
                                    lastsel=id;
                                }
                                jQuery('#grid').editRow(id,true,pickdates,checksave);
                            }

02/06/2009
01:46
Avatar
jonhb
Member
Members
Forum Posts: 12
Member Since:
27/05/2009
sp_UserOfflineSmall Offline

and also pickdates:

                    function pickdates(id){
                        jQuery("#"+id+"_woPlannedStartupDate","#wogrid").datepicker({dateFormat:"yy-mm-dd"});
                        jQuery("#"+id+"_woPlannedCompletionDate","#wogrid").datepicker({dateFormat:"yy-mm-dd"});
                    }

04/06/2009
04:46
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

HEllo,

Sorry to ask you again - which version? (if this is a 3.4.x I see something that I do not like - also if this is the case could you please try with the last 3.5 beta?)

Reagrds

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.

05/06/2009
02:27
Avatar
jonhb
Member
Members
Forum Posts: 12
Member Since:
27/05/2009
sp_UserOfflineSmall Offline

hi,

i use 3.4.3 yes..

will try 3.5 but hopefully this could be fixed in 3.4.3?

05/06/2009
03:49
Avatar
jonhb
Member
Members
Forum Posts: 12
Member Since:
27/05/2009
sp_UserOfflineSmall Offline

just now tried 3.5, but i can't get access to the grid? it's greyed out like when you open a modal dialog. data and everything is fine.

I already use UI and have modified some bits so I don't really want to download a new version. I also see that I have no borders around the cells in the grid and also the Loading information is on top of the grid and not in the middle like in the 3.5 demos.

09/06/2009
02:25
Avatar
jonhb
Member
Members
Forum Posts: 12
Member Since:
27/05/2009
sp_UserOfflineSmall Offline

hi tony,

any luck finding out if this is a bug in 3.4.4?

running out of time here now. Have to figure this out very soon.

09/06/2009
09:09
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

We all have problems with the time.

Could you please get the setted values before to call editRow

I mean

                            onSelectRow: function(id){
                                if(id && id!==lastsel){
                                    jQuery('#grid').restoreRow(lastsel);
                                    lastsel=id;
                                }

var selparams = $("#mygrid").getColProp('field1');
                                jQuery('#grid').editRow(id,true,pickdates,checksave);

See what values you have in editoptions

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/06/2009
02:26
Avatar
jonhb
Member
Members
Forum Posts: 12
Member Since:
27/05/2009
sp_UserOfflineSmall Offline

hi,

think i found something, probably not jqgrid related?

i use getJSON to populate the editoptions like this:

$.getJSON('getLibraryValues.do?', {libraryType: 'WO_ICC_MILESTONE', superiorOrder: val },
  function(j) {
    var options = ':;';
    for (var i = 0; i < j.length; i++) {
       options += j[i].optionValueParents + ':' + j[i].optionDisplayParents + ';';
    }
    options = options.slice(0,-1);
    $('#wogrid').setColProp('woMilestoneSubMilestoneId', {editoptions:{value:options}});
// here options in grid are correct!! 

})

// but here outside JSON function options are wrong.

Is there another way I have to do this?

12/06/2009
02:03
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Aha - you made ajax request, and this request delayed the setting. Also try with async:false in the ajax call.

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