Announcement

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

    ListGrid: get records and some data

    Hello,

    I have the following scenario:

    - I have a REST service that returns JSON data in the format below:
    main object
    list of objects
    object

    - In the UI, I have:
    - A ListGrid that I need to populate with the list of objects returned by the REST service.
    - Some labels that depend of the object returned by the REST service.

    I try to use a DynamicForm and format the data in the execute method. It works, but in devel console I can see this warning:
    WARN:RecordEditor:isc_ListGrid_1filterEditor:No editable fields in this record editor. Check the 'canFilter' property for each field in isc_ListGrid_1

    Can anyone lead me to a better solution?


    Thanks in advance,
    agalvao

    PS: using SmartGWT 2.4 LGPL

    #2
    Another problem with this approach is that the setHilites does not work...

    Any clue?

    agalvao

    Comment


      #3
      Anyone can help?

      This is really important for me...

      agalvao

      Comment


        #4
        The setHilites problem is solved.
        I was comparing using a string instead of a boolean. Fix this and the hilites are applied.

        But the initial WARN message persists.

        Any help?

        agalvao

        Comment


          #5
          See the FAQ about the information you should be posting to get attention from either the community or Isomorphic.

          Comment


            #6
            Code sample:
            Code:
            DynamicForm form = new DynamicForm();
                    form.setDataSource(dataSource);
                    form.saveData(new DSCallback() {
            @Override
                        public void execute(DSResponse response, Object rawData, DSRequest request) {
                            Record[] data = response.getData();
                            if (data == null || data.length == 0) {
                                return;
                            }
                            Record[] object = data[0].getAttributeAsRecordArray("object");
                            if (object == null || object.length == 0) {
                                return;
                            }
                            Record[] list = object[0].getAttributeAsRecordArray("list");
                            boolean myObj = object[0].getAttributeAsBoolean("myobj");
            
                            ListGrid grid = getGrid();
                            setGridFiels();
                            grid.setData(list);
                            if (!myObj ) {
                               //Do something
                            }
            
                            grid.setHilites(Utils.hilites);
                           }
                    });

            Comment

            Working...
            X