Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGrid FilterEditor text getting focused after filtering

    SmartClient Version : Smartclient v8.2p_2012-06-07 - Power Edition

    Browser : IE 9 , Chrome :Version 25.0.1364.172 m

    Issue : We are using a listgrid with the filterOnKeyPress set to true and we display the filterEditor using a button click(HideFilter/ShowFilter). The filtering works fine on keypress (We call the filterData function and pass the criteria and make a server call to retrieve the data). After the filtering is complete the text in the filter field is getting highlighted as shown in the screen shot. Because of this the user cannot continuously type instead he has to press the right arrow which will deselect the text and continue typing. We would like to find out if some one encountered similar situation and what was done to not have the filter text selected.
    Attached Files

    #2
    This might happen if you have showPrompt:true on your request, and have selectOnFocus set on the field. This combination of settings block interaction during the fetch, which requires keyboard focus to be moved out of the field during the fetch. Then, when keyboard focus is restored, it would select all the characters.

    The default for showPrompt for the FilterEditor is false, but perhaps you've done some sort of customization to force it to true.

    Comment


      #3
      ListGrid FilterEditor text getting focused after filtering

      We are using fetchData inside filterData(criteria) to make the server call. I set the "showPrompt = false"(showPrompt : false is throwing a js exception about the :) and it still was focusing the text. Also I saw in the api that selectOnFocus is not available for the filterEditor. Is there a way to access the fieldEditor editor's textFields and then set the selectOnFocus to false ?

      isc.ListGrid.create({
      ID: "dummyList",
      width: "100%",
      height: "100%",
      autoDraw:false,
      dataSource: dummyDS,
      autoFetchData: false,
      canHover:true,
      bodyOverflow:"hidden",
      bodyBackgroundColor: "#FFFFFF",
      leaveScrollbarGap: false,
      showFilterEditor:false,
      canSort:false,
      canResizeFields:false,
      canAutoFitFields:false,
      showHeaderContextMenu:false,
      filterOnKeypress: true,
      allowFilterExpressions: true,
      headerHeight: 40,
      dataProperties:{useClientFiltering:false},
      Last edited by subashk; 20 Mar 2013, 13:12.

      Comment


        #4
        showPrompt = false would not do anything. Never mind selectOnFocus, just set showPrompt correctly to solve the problem. You need to pass the showPrompt setting via the requestProperties argument of ferchData().

        Comment


          #5
          ListGrid FilterEditor text getting focused after filtering

          Thank you for your assistance. We were able to resolve the issue by passing the requestProperties to filterData and then to fetchData. Before we were only passing criteria as the argument as callback and requestProperties were both optional.

          Before
          filterData(criteria){
          fetchData(crtieria,callback function());
          }

          After
          filterData(criteria,callback,requestProperties){
          fetchData(crtieria,callback function(),requestProperties);
          }

          Comment

          Working...
          X