Announcement

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

    ListGrid data refresh

    I have a listgrid with two fields: boolean1, string1 and a recordClick function which goes back to the server, does some calculations and changes data for the listgrid. Once back in the browser, we have code to send a fetch request for the new data. Nevermind WHY such a process is done, the problem is that my string1 gets updated in the listgrid, but the checkbox does not. In my transformRequest I check the data of boolean1 and it is the data that I have set it to but it is not the case on the listgrid.

    I am using SC8 build May29

    #2
    If you directly change values on a record, use refreshCell() or refreshRow(), or, for several changes, markForRedraw().

    Comment


      #3
      Where do you recommend doing a call on any of the previously mentioned functions? I've tried adding them to dataArrived but still the same result. I'm not exactly sure why these calls would make a difference in my case since I do see data changing for other cells, but not for my boolean.

      Also note, this behaviour functioned properly in SC7

      Comment


        #4
        Hmm..I just played around with transformResponse..it seems that if I change the value coming in with the data as shown below, it works fine. Is this a new restriction? I recall being able to send either a true/false string or a 0/1 and the listgrid with interpret it properly.

        if(data[0].test == 0 || data[0].test == "false"){
        data[0].test = false;
        }else if(data[0].test == 1 || data[0].test == "true"){
        data[0].test = true;
        }

        Comment


          #5
          You should definitely pass actual boolean values, not Strings. Behavior if you do not pass proper booleans is not specified.

          Comment


            #6
            hmm...ok. Do you know if this is a change in SC8? Because the data that is being sent for the listgrid is in json format and it was always sending a "true"/"false" or "0"/"1". It worked in SC7.

            Comment


              #7
              We don't generally track changes to behaviors that are not specified.

              However, if you are using a DataSource with dataFormat:"json" and have declared the field as type "boolean", "true" and "false" delivered as Strings works.

              What's not specified is what would happen if you provided JSON data directly to a grid without using true boolean values.

              Comment

              Working...
              X