[Suggestion] Sortable Headers

Development information and discussion about EDK.
Post Reply
Thades
Noob
Posts: 1
Joined: Sat Sep 17, 2011 13:43

[Suggestion] Sortable Headers

Post by Thades »

Make the table headers sortable by implementing one of the javascript frameworks like yahoo or do it in php.

class.contractlisttable.php
* Sorts campaigns by efficiency

Code: Select all

189		usort($tbldata, array("ContractListTable", "cmpefficiency"));
190		// print_r($tbldata);
191		return $tbldata;
192	}
193
194	public static function cmpefficiency($a, $b)
195	{
196		if($a["efficiency"] == $b["efficiency"])
197			// < for DESC > for ASC
198			return ($a["name"] > $b["name"]) ? +1 : -1;
199		// < for DESC > for ASC
200  	return ($a["efficiency"] < $b["efficiency"]) ? +1 : -1;
201	}

Post Reply