Announcement

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

    selectionUpdated not fired at TileGrid

    Hi there,

    I'm tying to set up the TileGrid. It seems that the selectionUpdated event is not fired. You can see, in the example below, that the console log is not fired.
    Because the TileGrid does implement the DataBoundComponent (http://www.smartclient.com/docs/rele...BoundComponent) it should support this method.

    It's reproducable in all browsers with the latest nightly of SmartClient_v100p_2015-11-10_Pro

    Code:
    animalData = [{
            picture : "Elephant.jpg",
            commonName : "Elephant (African)",
            information : "test1",
            lifeSpan : 60,
            scientificName : "Loxodonta africana",
            diet : "Herbivore",
            status : "Threatened"
        }, {
            picture : "Alligator.jpg",
            commonName : "Alligator (American)",
            information : "test21",
            lifeSpan : 50,
            scientificName : "Allligator mississippiensis",
            diet : "Carnivore",
            status : "Not Endangered"
        }
    ];
    isc.TileGrid.create({
        ID : "dropzoneElement",
        width : "100%",
        height : "100%",
        tileWidth : 150,
        tileHeight : 205,
        data : animalData,
        selectionUpdated : function (p1, p2) {
            console.log([p1, p2]);
        },
        fields : [{
                name : "picture"
            }, {
                name : "status",
                getCellStyle : function (value, field, record, viewer) {
                    if (value == "Endangered")
                        return "endangered";
                    else if (value == "Threatened")
                        return "threatened";
                    else if (value == "Not Endangered")
                        return "notEndangered";
                    else
                        return viewer.cellStyle;
                }
            }
        ],
    });
    Best Regards

    #2
    Not all DataBoundComponent APIs are available on every class that implements the interface. For example, the whole concept of Selection does not apply to DynamicForm, and only a subset of the Selection APIs are available on CubeGrid.

    Currently, TileGrid doesn't support the selectionUpdated API. However, there's nothing preventing it from being added in a future version - it just hasn't been prioritized, due to a lack of requests. If adding this feature is particularly important to you, consider Feature Sponsorship.

    Comment


      #3
      Thanks for the explanation.

      Could you please prioritize the selectionUpdated on the TileGrid? I think this would be an improvement for the TileGrid-api, especially if the users know this api in most-used listgrids and treegrids.
      Maybe this requests helps the method to be added to the TileGrid.

      Best Regards

      Comment


        #4
        We had already noted that you're interested in this API. Now it's just a matter of seeing if a few other people care, in which case it will get prioritized over other items that have been requested multiple times.

        Comment


          #5
          I've tried to work with the selectionChanged-event, but the event is fired everytime a record is selected. So if the TileGrid has the option to select multiple elements every time the user use the shift-key to select multiple elements a request for every tile which was selected is fired. With this behaviour it's quite hard to work with.
          Do you have an hint, how I could be informed about a new selection without getting many requests to the server and without implemented selectionUpdated?
          Click image for larger version

Name:	Animation 22.gif
Views:	143
Size:	99.5 KB
ID:	232714
          This is the code
          Code:
          testData = [
              {
                  value: 1,
                  elementId: 1
              },
              {
                  value: 2,
                  elementId: 2
              },
              {
                  value: 3,
                  elementId: 3
              },
              {
                  value: 4,
                  elementId: 4
              },
              {
                  value: 5,
                  elementId: 5
              },
              {
                  value: 6,
                  elementId: 6
              }];
          isc.VLayout.create({
              ID : "vLayout",
              width : "100%",
              height : "100%",
              members : [
                  isc.TileGrid.create({
                      ID : "tilegrid",
                      width : "100%",
                      height : "100%",
                      canReorderTiles : false,
                      showAllRecords : true,
                      selectionType : "multiple",
                      tileWidth : 50,
                      tileHeight : 50,
                      data : testData,
                      selectionChanged : function (p1, p2) {
                          console.log("Selection changed called with Id: " + p1.elementId + " - "+p2);
                      },
                      fields: [
                          {name:"value"}
                       ]
                  })]
          });

          Comment


            #6
            I read this post and I think the selectionUpdated method is a base operation for grids and the TileGrid should include it.

            Best Regards

            Comment


              #7
              Just so you know, we can see your registration company. Getting a co-worker to post here so that it looks like there are multiple requests is, unfortunately, just going to make us look with great skepticism on any other users posting that they want the feature.

              As far as how to use selectionChanged: you just use the common coding technique of setting a timer, and not actually taking an expensive action until the timer expires, while re-setting the timer if another selection event fires.

              Comment

              Working...
              X