ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: developer1 on June 10, 2022, 07:14:15 pm

Title: How to bind dropdown in pqgrid with Id and Name
Post by: developer1 on June 10, 2022, 07:14:15 pm
We have a scenario to bind Id as a value and Name as a Field  in dropdown

Could you provide us a demo for that?

Id=1 Field='India'
Id=2 Field='Us'
Id=3 Field='Australia'

When We select India from dropdown then prompt the message, You have selected 1 Id
Title: Re: How to bind dropdown in pqgrid with Id and Name
Post by: paramvir on June 13, 2022, 10:17:21 am
Please check ShipVia3 column in this example: https://paramquery.com/pro/demos/editing_custom

It has options in the same format.

And use this code in column.editor.init to alert the value of dropdown.

Code: [Select]
init: function(ui){
ui.$editor.on('change', function(evt){
//alert($(evt.target).find('option:selected').text());
alert($(evt.target).val());
});
}