For View Column Sorting

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View For View Column Sorting as PDF for free.

More details

  • Words: 214
  • Pages: 2
// append to bottom of docbean //protected boolean isdefaultascending(string sortcolumn) // { // return true; // } // // public void sort(final string column, final boolean ascending) // { // comparator comparator = new comparator() // { // public int compare(object o1, object o2) // { // selectableitem selectableitem1 = (selectableitem)o1; // document c1 = (document)selectableitem1.getitem(); // selectableitem selectableitem2 = (selectableitem)o2; // document c2 = (document)selectableitem2.getitem(); // // if (column == null){ // return 0; // } // if (column.equals("filename")){ // return ascending ? c1.getfilename().compareto(c2.getfilename()) : c2.getfilename().compareto(c1.getfilename()); // } // else if (column.equals("subject")){ // return ascending ? c1.getsubject().compareto(c2.getsubject()) : c2.getsubject().compareto(c1.getsubject()); // } // else if (column.equals("creator")){ // return ascending ? c1.getuserid().compareto(c2.getuserid()) : c2.getuserid().compareto(c1.getuserid()); // } // else if (column.equals("createdate")){ // return ascending ? c1.getcreateddatetime().compareto(c2.getcreateddatetime()) : c2.getcreateddatetime().compareto(c1.getcreateddatetime()); // } // else if (column.equals("updatedate")){ // return ascending ? c1.getlastupdatedatetime().compareto(c2.getlastupdatedatetime()) : c2.getlastupdatedatetime().compareto(c1.getlastupdatedatetime()); // } // else return 0; // } // }; // // collections.sort(documents, comparator); // } // // public boolean isascending() { // return ascending; // } // // public void setascending(boolean ascending) { // this.ascending = ascending;

// // // // // // // // // // // //

} public string getsort() { if (sort == null){ sort = "filename"; } return sort; } public void setsort(string sort) { this.sort = sort; }

Related Documents

For View Column Sorting
November 2019 13
Sorting
May 2020 22
Sorting
July 2020 22
Sorting
April 2020 18
Sorting
November 2019 28
Sorting
April 2020 29