Author Topic: Option select when open a picklist on cell  (Read 3455 times)

noctrona

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 82
    • View Profile
Option select when open a picklist on cell
« on: April 25, 2014, 01:21:00 pm »
Hi,

I have a column use "type: 'select'" to generate a picklist. But as I used, if I choose a value in this picklist and save this value on cell, then I open picklist again, the value which I save didn't be choose, the first value in the picklist will be choose.
I check some demo which used picklist have this problem too.

This is my column:
Code: [Select]
{ title: "Product",  dataIndx: "product",width: 130,
                          editor: {
                              type: "select", options: productArray,style: 'width:230px;'
                          },
                          render: function (ui) {
                              return (ui.cellData.split(':')[0])
                             
                          }
}

And this is my pick list source:

Code: [Select]
var productArray = [];

for(var i = 0; i < productList.length; i++ ){
                    var idVals = productList[i].Name+'-'+ productList[i].Description + ':' + productList[i].Id;
                    var nameVal = productList[i].Name+'-'+productList[i].Description;
                    var obj = {};               //create an empty object
                    obj[idVals] = nameVal;      //create a new property with a dynamic key and assign to value.
                    productArray.push(obj);     //push onto the productArray

}


So do we have solution to handle this problem? When open the picklist the current value will be choose as highlight not the first picklist value.


Thank you!

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Option select when open a picklist on cell
« Reply #1 on: April 25, 2014, 10:03:31 pm »
The selected value is highlighted in the select list, but not the first one.

Please refer to this demo:

http://paramquery.com/pro/demos/editing_custom

noctrona

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 82
    • View Profile
Re: Option select when open a picklist on cell
« Reply #2 on: April 28, 2014, 02:44:46 pm »
The selected value is highlighted in the select list, but not the first one.

Please refer to this demo:

http://paramquery.com/pro/demos/editing_custom

Hi,

I post a reply but looks like didn't pass approved.

I check the pick list function in this demo. I choose a book from book pick list and save this cell. Then when I double click this cell the book name which I selected will display on the pick list but only this value, other parts in the pick list didn't display.
Do we have solution can show the whole pick list and highlight the selected value too?


Thank you!

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Option select when open a picklist on cell
« Reply #3 on: April 28, 2014, 03:37:49 pm »
Noctrona

Book column which you referred to in your new post is not a select list but it is jQueryUI autocomplete. It is answered here http://paramquery.com/forum/index.php?topic=626.0
« Last Edit: April 28, 2014, 03:48:14 pm by paramquery »