Class GridUtil


  • public class GridUtil
    extends Object
    Utility methods for documents grids
    Since:
    7.0
    Author:
    Marco Meschieri - LogicalDOC
    • Constructor Detail

      • GridUtil

        public GridUtil()
    • Method Detail

      • getIds

        public static long[] getIds​(com.smartgwt.client.data.Record[] records)
      • toDocuments

        public static GUIDocument[] toDocuments​(com.smartgwt.client.data.Record[] records)
      • toDocument

        public static GUIDocument toDocument​(com.smartgwt.client.data.Record record)
      • fromDocument

        public static com.smartgwt.client.widgets.grid.ListGridRecord fromDocument​(GUIDocument doc)
      • updateRecord

        public static void updateRecord​(GUIDocument doc,
                                        com.smartgwt.client.data.Record record)
      • getSortSpec

        public static String getSortSpec​(com.smartgwt.client.widgets.grid.ListGrid grid)
        Takes the sort specification of a grid. It is a string of comma separated values each one defining the sorting of a specific attribute of the document, eg: fileName asc, date desc
        Parameters:
        grid - the grid to inspect
        Returns:
        the full sort specification
      • getSortSpec

        public static String getSortSpec​(com.smartgwt.client.data.SortSpecifier[] sortSpecifiers)
      • getPageSizeFromSpec

        public static Integer getPageSizeFromSpec​(String spec)
        Gets the page size from the layout specification, the format is: |pageSize|gridLayout
        Parameters:
        spec - layout specification
        Returns:
        the page size
      • getGridLayoutFromSpec

        public static String getGridLayoutFromSpec​(String spec)
        Gets the grid layout specification, the format is: |pageSize|gridLayout or simply gridLayout
        Parameters:
        spec - layout specification
        Returns:
        grid definition