Announcement

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

    ListGrid fetchData - FOCUS PROBLEM

    Hello Isomorphic!

    I got an urgent problem which i can't fix or workaround!
    Since we bought the Pro-Version we would appreciate if you could fix this problem as soon as possible.

    Here is an example code for a showcase example!

    If you go to the jsonDataSource or xmlDataSource ->
    https://www.smartclient.com/smartcli...jsonDataSource
    ->

    and copy this code to the databound.js

    isc.VLayout.create({
    members: [
    isc.ListGrid.create({
    ID: "countryList",
    width:500, height:224, alternateRecordStyles:true, showAllRecords:true,
    dataSource: countryDS,
    autoFetchData: true,
    canEdit: true,
    selectionUpdated: function(record) {
    DV1.setData(null);
    DV1.fetchData ({countryCode: record.countryCode}, function(dsResponse, data){
    })
    }
    }),
    isc.DetailViewer.create({
    ID: 'DV1',
    dataSource: countryDS,
    })
    ]
    })

    I got following problem!
    -> if you edit a cell in the listGrid and then move to the next row with keyDown you loose the focus and the selection of the next cell!! (which is happening in cause of the fetchData)
    -> nevertheless i can't fix this problem and i need the fetchdata to reload the detailviewer
    -> it also doesn't work if i use fetchRelatedData
    -> or if i directly use countryDS.fetchData({countryCode: record.countryCode}, function(dsResponse, data){ DV1.setData(data) });
    -> as soon as i use any kind of fetchData the focus & selection is lost

    I found out if i try the same code in the localDataSource ( https://www.smartclient.com/smartcli...ocalDataSource )
    it works,-- cause the request is not directly a new fetchData event


    Thank You !

    best regards Thaddäus!


    #2
    You can just call DV1.viewSelectedData(grid), instead of the calls to setData() and fetchData().
    Last edited by Isomorphic; 8 Aug 2018, 01:38.

    Comment


      #3
      Thank you for the fast response!

      Ok, this would fix the problem if i wouldn't have different dataSources

      How can i fix it with different dataSources on the listGrid and detailViewer ( with viewSelectedData the detailViewer won't show the additional fields which aren't in the record of the listGrid )

      Thank you

      Edit: We have this problem, since we updated from Smartclient 10 to 12.

      Edit2: The same example (like above) works here : https://www.smartclient.com/smartcli...#xmlDataSource
      Last edited by Thaddaeus; 8 Aug 2018, 01:59.

      Comment


        #4
        From testing your sample, we don't see what you mean about focus and selection being lost - both seem to be retained, since you can navigate more than once with the arrow keys, with both selection and the detailViewer being visually updated.

        If you aren't seeing that (you didn't mention which build or skin you're using), have you tried setting { showPrompt: false } in the requestProperties of your fetchData() call? That would be expected to prevent loss of focus due to server round-tripping.

        Comment


          #5
          Ok i could fix the problem with the showPromt:false requestProperties
          DV1.fetchData ({countryCode: record.countryCode}, function(dsResponse, data){},{ showPrompt: false })


          so this example works: ->

          isc.VLayout.create({
          members: [
          isc.ListGrid.create({
          ID: "countryList",
          width:500, height:224, alternateRecordStyles:true, showAllRecords:true,
          dataSource: countryDS,
          autoFetchData: true,
          canEdit: true,
          selectionUpdated: function(record) {
          DV1.setData(null);
          DV1.fetchData ({countryCode: record.countryCode}, function(dsResponse, data){
          },{ showPrompt: false })
          }
          }),
          isc.DetailViewer.create({
          ID: 'DV1',
          dataSource: countryDS,
          })
          ]
          })


          Thank you very much!! -- i'll get you a beer when i'm in san francisco :D


          just for understanding the problem:
          ( changing selections with downKey )

          ..........................................smartclient 10 ................................................................................... smartclient 12

          Click image for larger version  Name:	smartclient_10.gif Views:	1 Size:	799.5 KB ID:	254366Click image for larger version  Name:	smartclient12.gif Views:	1 Size:	794.9 KB ID:	254367

          Comment

          Working...
          X