-
Notifications
You must be signed in to change notification settings - Fork 33
Minimum effort
One of the main objectives of the KingTable widget is to allow the implementation of administrative tables with the minimum amount of effort from the developer; especially on the client side.
For example, in order to obtain the table shown in the examples and in the demo, this is the amount of client code which is required:
$("#content").kingtable({
url: "/api/colors",
columns: {
name: "Name",
color: {
displayName: "Color",
template: "<span class=\"ui-color\" style=\"background-color:{{color}}\"></span>{%print($highlight(color))%}"
},
red: "Red",
green: "Green",
blue: "Blue",
hue: "Hue",
hslLight: "Light (HSL)",
hslSaturation: "Saturation (HSL)",
hsvSaturation: "Saturation (HSV)",
hsvValue: "Value (HSV)"
}
});Notice how for the most part, this information simply consists of the display names of the columns. The built table offers pagination controls, search field; a menu to hide/reorder the columns; a menu to export the displayed results in csv, json and xml formats.
And this is not everything: for collections that don't require server side pagination (fixed tables), the KingTable widget takes care also of the client side pagination and search functionality, without any input from the programmer.