Author Topic: One click to open custom select editor  (Read 2567 times)

stoodin

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 85
    • View Profile
One click to open custom select editor
« on: December 16, 2014, 07:35:32 pm »
Is there any way to make custom select editor to be open just on one click? The way it works now (even in your demo) the first click just shows the drop down the second click opens it.
I am using
editModel: {
           saveKey:$.ui.keyCode.ENTER,
           cellBorderWidth: 1,
           clicksToEdit: 1,
           onBlur: 'save',
            keyUpDown:true},

and the editor:
var usersDropDownEditor2 = function (ui, getUsrUrl, searchParam, wdth, callType) {
   var $inp = ui.$cell.find("select");
       rowData = ui.rowData,
       dataIndx = ui.dataIndx,
       dataCell = rowData[dataIndx];

    if (isStringEmpty(wdth))
       wdth = '300px';

   // alert(wdth);
    $inp.width(wdth);
   
    $.ajax({
       url: getUsrUrl,
       type: callType,
       data: searchParam,
        dataType: "json",
        cache: false,
       success: function(json_arr) {
          var opt = $('<option />'),
             fullDesc, empId;
          
          $inp.append(opt);
          
          $.each(json_arr, function(i,val) {
             opt = $('<option />');
             empId = val.employeeId,
             fullDesc = val.rlfName;
             opt.attr('value', empId).text(fullDesc);
             
               if (dataCell && dataCell == fullDesc) {
                  opt.attr('selected', 'selected');
               }
              
               $inp.append(opt);
           });

       },
        error: function(xhr, error) {
           alert("System Error: " +  xhr.responseText);
        }
    });
};

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: One click to open custom select editor
« Reply #1 on: December 16, 2014, 11:01:04 pm »
Currently the select editor can't be opened upon creation, it requires another click to open it, this is the limitation of the browser's inbuilt select list.

ParamQuery Select ( custom select or dropdown list ) would support this and it would be available along with the upcoming version of SDK.