Announcement

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

    SelectItem : get multiple records

    Hi! I was wondering if it is possible to get all the records marked for a selectitem with multiple=true, not only the values.

    Regards

    #2
    It already exists just not exposed in SmartGWT yet, but you can access it through JSNI very easily. It is literally called getSelectedRecords() :)

    Comment


      #3
      Thanks for your help. I never used JSNI before, how can I access the component JS method?

      Regards

      Comment


        #4
        I created a subclass of SelectItem and add this method:
        Code:
        public native ListGridRecord[] getSelectedRecords() /*-{
        		var self = this.@com.smartgwt.client.core.DataClass::getJsObj()();
        		var dataJS = self.getSelectedRecords();
        		return @com.smartgwt.client.widgets.grid.ListGrid::convertToListGridRecordArray(Lcom/google/gwt/core/client/JavaScriptObject;)(dataJS);
        	}-*/;

        It is now working :)

        Thanks a lot

        Comment


          #5
          Hello,

          Thanks for your code, but it doesn't totally workk.
          When the selection is empty,
          Code:
          getSelectedRecords()
          returns a list with the first element of the SelectItem

          If you could you post a correction, it would be great

          Thanks

          Comment

          Working...
          X