ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: angelahlp on May 15, 2015, 03:28:49 am

Title: select input with valueIndx and lableIndx
Post by: angelahlp on May 15, 2015, 03:28:49 am
Hello - I'm trying to set an INT for the value and the text for the label - I'm using the following but it's not working - the array that is passed for the options is a JSON array. I'm using version 2.3 - if this doesn't work until 2.4 - is there another way to do this with earlier versions?

          { title: "SELECT NAME",  dataIndx: "selectid",
            editor: {
               type: 'select',
               options: arrSelect,
               valueIndx: "selectid",
               labelIndx: "selectname"
            }
         },

Any Help is Appreciated --

Thanks,
Angela
Title: Re: select input with valueIndx and lableIndx
Post by: paramvir on May 15, 2015, 08:27:43 pm
This is supposed to work even in 2.3.0

The JSON format should be correct.

[{ "selectid": id1, "selectname": "value1"}, ...]
Title: Re: select input with valueIndx and lableIndx
Post by: angelahlp on June 24, 2015, 12:22:32 pm
I've come back to this and still need help. The problem I am having is that after I select an option in the drop down the value turns into the id - instead of staying as the string value. It is also not sending the value of the id when an update is made.

The json string is:
[{"commandid":6,"command":"Talk"},{"commandid":5,"command":"Sit"},{"commandid"
:16,"command":"stand"},{"commandid":14,"command":"bark"}]

The code I'm currently trying is below. I've tried many variations with no luck:
{ dataIndx: "commandid", hidden: true },
{ title: "Type", minWidth: 30, width: 100, dataIndx: "command",
editor: {
type: 'select',
options: arrCommands,
mapIndices: {"name": "command", "id": "commandid"},
valueIndx: "command",
labelIndx: "command"
}
},

I would appreciate it if you could give me some insight on what I'm doing wrong here :) TIA!
Title: Re: select input with valueIndx and lableIndx
Post by: paramvir on June 24, 2015, 08:30:04 pm
mapIndices is not supported in 2.4.x but that doesn't seem to be required in your case.

you have kept valueIndx and labelIndx to be same, is it intentional in that you don't need id in select list?

If you are interested in string values only, you may also keep options format as array of strings.
[ "Talk", "Sit", "stand", ....]

It would be great if you could share a small jsfiddle if you are still facing issues.
http://jsfiddle.net/paramquery/0g30xsv4/1/