Announcement

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

    #16
    Then it should be very easy to produce a standalone test case.

    Comment


      #17
      Originally posted by Isomorphic
      Then it should be very easy to produce a standalone test case.
      yep i think to ;) i will make one tonight or tomorrow

      Comment


        #18
        I have been having trouble with interaction between ListGrids and clientOnly:true datasources when it comes to removing records.

        After much poking around, the simplest example of failure I could come up with is the following:

        Open the feature explorer:

        /isomorphic/system/reference/SmartClient_Explorer.html#localDataSource

        OR browse to the 'Data Binding' > 'Lists' > 'Local DataSource' example.

        Go to the JS tab and add the line canRemoveRecords:true so that it looks as follows:

        Code:
        isc.ListGrid.create({
            ID: "countryList",
            width:500, height:224, alternateRecordStyles:true, showAllRecords:true,
            dataSource: countryDS,
            autoFetchData: true,
            canRemoveRecords:true
        })
        Click 'Try It'...

        Although the red crosses appear by each row, if I click one, the record does not disappear.

        I would expect the behaviour of a clientOnly datasource to be that when I click remove, the record is removed from the testData set.

        Programatically calling removeSelectedData or removeData(primary_key) on the ListGrid also do not result in the records disappearing.

        Behaves this way on SmartClient 7.0rc2 (& nightly SmartClient_SC_SNAPSHOT-2010-07-17) on Win:IE8 IE7 OSX:FF Chrome Safari

        Comment


          #19
          That DataSource has no primaryKey declared. Primary keys are required for data changing operations to complete (for any DataSource type).

          Comment


            #20
            Many thanks, this solved my problem. It appears to have solved my programatically calling the remove functions, too.

            Comment


              #21
              If anyone is interested, I found another way to remove data from list grid:
              Code:
              RecordList list = listGrid.getRecordList();
              for (int i = list.getLength()-1; i >=0 ; i--) 
              	listGrid.removeData(list.get(i));

              Comment


                #22
                Code:
                yourListGrid.setData(new ListGridRecord[0]);
                should empty the list.

                Comment


                  #23
                  Hi,

                  Take a look at this post -> http://uptick.com.au/content/crud-gwt-gwtp-smartgwt-and-jpa and the ListGrids used in the sample code.

                  Cheers
                  Rob

                  Comment


                    #24
                    Originally posted by Isomorphic
                    You're the only one experiencing this "bug" while others are reporting that it works.

                    Don't file a ticket. Try producing a standalone test case instead.
                    Actually I also met the exactly same issue, maybe some more other people met this same issue but just did not report here... very horrible bug...

                    Comment


                      #25
                      I add datasource to a listgrid and use the ds just for client-only. prior to smartgwt 2.2 releases,we use the following two code lines to clear the data in the list grid and it worked fine:
                      listgrid.invalidateCache();
                      listgrid.getDataSource().setTestData(null);

                      now we use Smartgwt2.5(we also tried the previous ones after 2.2)and we cannot clear the listgrid data.

                      Comment


                        #26
                        Info to clear ListGrid

                        I beliew in self coding,

                        rlPriceGrid.setData(new ListGridRecord[] {});

                        How many agree with me....:)

                        Comment

                        Working...
                        X