Announcement

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

    Odd Behavior After Remove Record on ListGrid

    I have a list grid, that has multiples of records, after i remove remove a record, the record is removed initially from the grid, however, when i mouse over any records, the removed record reappears, and it also invalidates the entire grid, meaning that i cannot perform any other actions, such as subsequant removes.

    Here is the list grid properties.

    alternateRecordStyles: true,
    canSort: true,
    dragTrackerMode: "record",
    canReorderRecords: true,
    canDragRecordsOut: false,
    canEdit: false,
    canRemoveRecords: true,
    cellPadding: 3,
    cellHeight: 28,
    alternateRecordStyles: true,
    showEdges: true,
    edgeSize: 1,
    filterOnKeypress: true,
    removeFieldProperties: { width: 28 },

    I am using RESTDATASOURCE, the remove event and response from the server is perfect, e.g. returning the primary key of the table, the table datsource has the primary key values set and all seems to be fine.

    One thing to note, is that after i refresh the entire page, the record that was removed, is actually remove, from the DB and does not appear in the grid anymore, which is fine, so there is no issue with the removal server side.

    Can you point me in some direction here, because i cannot seem to figure out why this is occuring... the consol shows no errors or warnings and i have step debuged my JS file..

    Also, If i reorder/sort the record by clicking the column header, the duff record goes again, and never returns on any mouse over events. However i'm still unable to click remove record for remaining records?

    Any ideas? pointers here?
    Attached Files

    #2
    What you've got there is basically a hung animation for the record removal. This basically *must* involve a JS error. You may have third-party JavaScript in the error that is preventing it from being reported, or your debugger might be flawed. Try other browsers and try removing anything not essential to this test case.

    Comment


      #3
      So i have found the problem, but i am lost in how to correct

      It's due to the FilterEditor, on this form i have FilterEditor=True, when i remove that there are no JS errors and the animation works fine, the actual error i found using FireFox, and the errors was

      Error: this.selection is undefined
      Source File: http://localhost:8080/netconomic/modules/client/system/modules/ISC_Forms.js?isc_version=7.0.0.js
      Line: 227

      Seems related to optionDataSources, however the select items work, they are showing a list of relevant data, but it is still throwing the error..

      Any thoughts?

      Comment


        #4
        Can you show the full stack trace for that error (available in the Developer Console in IE). Alternatively, can you reproduce the problem by modifying a sample?

        Comment


          #5
          example below

          The following HTML takes 2 Datasources which are attached to the ListGrid, with showFilterEditor: TRUE it throws null error, set to false and it's fine.

          <HTML>
          <HEAD>
          <TITLE></title>
          <META http-equiv="content-type" content="text/html; charset=UTF-8"/>
          <SCRIPT>

          var isomorphicDir = "modules/client/";

          </SCRIPT>
          <SCRIPT SRC="modules/client/system/modules/ISC_Core.js?isc_version=7.0.0.js"></SCRIPT>
          <SCRIPT SRC="modules/client/system/modules/ISC_Foundation.js?isc_version=7.0.0.js"></SCRIPT>
          <SCRIPT SRC="modules/client/system/modules/ISC_Containers.js?isc_version=7.0.0.js"></SCRIPT>
          <SCRIPT SRC="modules/client/system/modules/ISC_Grids.js?isc_version=7.0.0.js"></SCRIPT>
          <SCRIPT SRC="modules/client/system/modules/ISC_Forms.js?isc_version=7.0.0.js"></SCRIPT>
          <SCRIPT SRC="modules/client/system/modules/ISC_DataBinding.js?isc_version=7.0.0.js"></SCRIPT>
          <SCRIPT SRC="modules/client/system/modules/ISC_Tools.js?isc_version=7.0.0.js"></SCRIPT>
          <SCRIPT SRC="modules/client/system/modules/ISC_FileLoader.js?isc_version=7.0.0.js"></SCRIPT>
          <SCRIPT SRC="modules/client/skins/TreeFrog/load_skin.js?isc_version=7.0.0.js"></SCRIPT>
          </HEAD>
          <BODY>
          <DIV id="wholePage">
          <DIV id="mainContentSection">
          <SCRIPT>

          {literal}
          isc.deferAutoDraw = true;

          gJournalStatus = [
          { statusName: 'Unposted', status: 'U' },
          { statusName: 'Posted', status: 'P' }
          ];

          isc.DataSource.create({
          ID: "gJournalStatus",
          fields:[
          {name:"statusName"},
          {name:"status"}
          ],
          clientOnly: true,
          testData: gJournalStatus
          });

          gReversalStatus = [
          { statusName: 'Reversed', status: 'R' },
          { statusName: 'Not Reversed', status: 'N' }
          ];

          isc.DataSource.create({
          ID: "gReversalStatus",
          fields:[
          {name:"statusName"},
          {name:"status"}
          ],
          clientOnly: true,
          testData: gReversalStatus
          });

          gApprovalStatus = [
          { statusName: 'Unapproved', status: 'U' },
          { statusName: 'Approved', status: 'A' }
          ];

          isc.DataSource.create({
          ID: "gApprovalStatus",
          fields:[
          {name:"statusName"},
          {name:"status"}
          ],
          clientOnly: true,
          testData: gApprovalStatus
          });




          isc.ListGrid.create({
          ID: "theList", height: "100%", width: "100%", autoFetchData: true,
          showFilterEditor: true,
          fields: [
          { name:"status", canEdit: false, title: "Status", type: "text", editorType: "select", optionDataSource: "gJournalStatus", valueField: "status", displayField: "statusName", defaultValue:"U" },
          { name:"approval_status", canEdit: false, title: "Approval Status", type: "text", editorType: "select", optionDataSource: "gApprovalStatus", valueField: "status", displayField: "statusName", defaultValue:"U" }
          ]});

          isc.VLayout.create({ID:"MAINLAYOUT", members: [theList]});

          {/literal}

          </SCRIPT> </DIV>
          </DIV>
          </BODY>
          </HTML>

          Comment


            #6
            Thanks for the test case. A workaround for now is to add your own column of type "icon" and call removeData(), which won't use an animation and so won't hang.

            Comment


              #7
              Ok, i did this, however i found another problem

              i get a object NaN has no method indexOf, if i have FROZEN field=true set to any field within the list grid, but only when i have an type: "icon" field in the field list, see updated example below.

              If you set the field statusName field property of frozen: true, it throws the following

              Uncaught TypeError: Object NaN has no method 'indexOf'

              example updated below:


              <HTML>
              <HEAD>
              <TITLE></title>
              <META http-equiv="content-type" content="text/html; charset=UTF-8"/>
              <SCRIPT>

              var isomorphicDir = "modules/client/";

              </SCRIPT>
              <SCRIPT SRC="modules/client/system/modules/ISC_Core.js?isc_version=7.0.0.js"></SCRIPT>
              <SCRIPT SRC="modules/client/system/modules/ISC_Foundation.js?isc_version=7.0.0.js"></SCRIPT>
              <SCRIPT SRC="modules/client/system/modules/ISC_Containers.js?isc_version=7.0.0.js"></SCRIPT>
              <SCRIPT SRC="modules/client/system/modules/ISC_Grids.js?isc_version=7.0.0.js"></SCRIPT>
              <SCRIPT SRC="modules/client/system/modules/ISC_Forms.js?isc_version=7.0.0.js"></SCRIPT>
              <SCRIPT SRC="modules/client/system/modules/ISC_DataBinding.js?isc_version=7.0.0.js"></SCRIPT>
              <SCRIPT SRC="modules/client/system/modules/ISC_Tools.js?isc_version=7.0.0.js"></SCRIPT>
              <SCRIPT SRC="modules/client/system/modules/ISC_FileLoader.js?isc_version=7.0.0.js"></SCRIPT>
              <SCRIPT SRC="modules/client/skins/TreeFrog/load_skin.js?isc_version=7.0.0.js"></SCRIPT>
              </HEAD>
              <BODY>
              <DIV id="wholePage">
              <DIV id="mainContentSection">
              <SCRIPT>

              {literal}
              isc.deferAutoDraw = true;

              gJournalStatus = [
              { statusName: 'Unposted', status: 'U' },
              { statusName: 'Posted', status: 'P' }
              ];

              isc.DataSource.create({
              ID: "gJournalStatus",
              fields:[
              {name:"statusName"},
              {name:"status"}
              ],
              clientOnly: true,
              testData: gJournalStatus
              });

              gReversalStatus = [
              { statusName: 'Reversed', status: 'R' },
              { statusName: 'Not Reversed', status: 'N' }
              ];

              isc.DataSource.create({
              ID: "gReversalStatus",
              fields:[
              {name:"statusName"},
              {name:"status"}
              ],
              clientOnly: true,
              testData: gReversalStatus
              });

              gApprovalStatus = [
              { statusName: 'Unapproved', status: 'U' },
              { statusName: 'Approved', status: 'A' }
              ];

              isc.DataSource.create({
              ID: "gApprovalStatus",
              fields:[
              {name:"statusName"},
              {name:"status"}
              ],
              clientOnly: true,
              testData: gApprovalStatus
              });


              gData = [
              { statusName: 'Unapproved', status: 'U' },
              { statusName: 'Approved', status: 'A' }
              ];

              isc.DataSource.create({
              ID: "gData",
              fields:[
              {name:"statusName"},
              {name:"status"}
              ],
              clientOnly: true,
              testData: gData
              });


              isc.ListGrid.create({
              ID: "theList", height: "100%", width: "100%", autoFetchData: true,
              showFilterEditor: true, dataSource: "gData",
              fields: [
              { name:"status", type:"icon", cellIcon: "[SKIN]actions/back.png" },
              { name:"statusName", frozen: true, canEdit: false, title: "Approval Status", type: "text", editorType: "select", optionDataSource: "gApprovalStatus", valueField: "status", displayField: "statusName", defaultValue:"U" }
              ]});

              isc.VLayout.create({ID:"MAINLAYOUT", width: "100%", members: [theList]});

              {/literal}

              </SCRIPT> </DIV>
              </DIV>
              </BODY>
              </HTML>

              Comment


                #8
                simple grid.setAnimateRemoveRecord(false) works for me
                (i'm using the removeField too)

                Comment

                Working...
                X