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
Jqgrid EditType 'Select' with both array as value
02/10/2014
11:52
Avatar
zizzzac
Member
Members
Forum Posts: 3
Member Since:
02/10/2014
sp_UserOfflineSmall Offline

Hi there,

This plugin was awesome and it really work exactly on how I wanted to, however there are one problem that I've encountered for weeks, I've tried all kinds of "help" section provides, but still no luck in the end, hopefully I can get my answer directly by posting instead of viewing other people solution which is not relevant to my situation... 

 

var json_parsed = $.parseJSON(result)

jQuery("#jqgrid").jqGrid({ data : json_parsed, datatype : "local", height : 'auto', width : 'auto', ...

{ name : 'badge_name', index : 'badge_name', align : "center", editable: true, formatter: 'select', edittype: 'select', editoptions: { value: { '1': 'Yes', '0': 'No' }}},

 

Is there any way that make the editoptions with both option_value:label_name based on array? Something like 

{ name : 'badge_name', index : 'badge_name', align : "center", editable: true, formatter: 'select', edittype: 'select', editoptions: { value: { array_option_value: array_option_label_name}}},

Another question is that, even though if i managed to pull it off with array variable, what i can imagine from here is, will the option label name become like

<option value="1,2,3">array,label,name</option>

and what i expect was

<option value="1">array</option>

<option value="2">label</option>

<option value="3">name</option>

03/10/2014
14:08
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

 

No such way,but note that the value option can be a function, which after called should return either a string or a object as described as the desired values.

 

Kind Regards

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.

04/10/2014
17:30
Avatar
zizzzac
Member
Members
Forum Posts: 3
Member Since:
02/10/2014
sp_UserOfflineSmall Offline

So is it can be return in this way...??

            value : {<?php

            if(isset($_COOKIE['option_value']))

            {

            echo $result[0].":'\.$result1[0]\.',2:'two'";

            }

            ?>}}},

i may need some examples or samples to help me imagining as i'm still playing with the syntax around due to the " and ' 

21/10/2014
17:51
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

 

Not sure what you try to do. You mix PHP with JavaScript

This should be something like

 

value : function ()

{

// do something here.

}

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

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