Themes
Jennifer
Dark
Leave a comment
Common Styles
Typography
Forms
Icons
Navigation Bar
Panel
Bar Graph
Grid
Accordion
Default accordion
Close accordion
Multi Panel
Auto Complete
Default auto complete
Update word list
Button
Buttons Style
Radio. Get selected value
Radio. Set to the index
Radio. Set to the value
Check. Set to the index
Check. Set to the value
Color Picker
Default colorpicker
Combo Box
Get selected text
Set to the index
Custom SelectBox
Simple Select Box
Position of Select Box
Multi Selection for Select Box
Date Picker
Date Picker Style
Calendar Style
Daily date picker
Set the date range
Monthly date picker
Yearly date picker
Daily calendar
Dropdown
Vertical Menu Style
Dropdown Menu Style
Show & Hide dropdown
Auto Close prevention
Control by keyboard
Update list
Layout
Split Screens
Modal
Global modal
Inside modal
Notification
Notify Style
Notification to the top
Notification to the bottom
Paging
Paging Style
Default paging
Use the paging on the table
Progress Bar
Progress Bar Style
Horizontal progress bar
Vertical progress bar
Property View
Simple Property View
Complex Property View
Property View in Window
Property View in Panel
Property View with Accordian
Slider
Slider Style
Single slider
Double slider
Splitter
Splitter for Vertical
Splitter for Horizontal
Border Layout (with minSize)
Switch
Switch Style
Default switch
Tab
Tabs Style
Top tabs
Bottom tabs
Tab manipulation
Tab dragging
Use dropdown menu
Table
Tables Style
Default table
Cell merge in row
Use the extended area
Scroll to rows
Select to multiple rows
Mouse right-click event
Sorting rows
Editing rows
Right-click editing rows
Remove row
Append rows
Insert rows
Hide & Show columns
Export to CSV file
Import to CSV file
Append/Insert tree rows
Move/Remove/Modify tree rows
Update tree rows
Changing the row position via drag events
Tooltip
Tooltip Style
Popover Style
Default tooltip
With popover style
Tree
Tree Menu Style
Append nodes
Move/Remove/Update node
Tree dragging
Window
Window Style
Message Box Style
Move & Resizing window
Modal window
Using a different style
X-Table
Data scrolling
Data paging
Data paging & scrolling
Data filters
Horizontal scroll bar
Virtual scrolling
Virtual scrolling (Append Tree)
Virtual scrolling (Update Tree)
Code
HTML
jui.ready([ "grid.xtable" ], function(xtable) { xtable_7 = xtable("#xtable_7", { fields: [ "name", "age", "location" ], resize: true, sort: [ 0, 1 ], width: 800, scrollWidth: 600, scrollHeight: 400, rowHeight: 26, buffer: "vscroll", tpl: { row: $("#tpl_row").html(), none: $("#tpl_none").html() }, event: { select: function(row, e) { if(row.type == "fold") { this.open(row.index); } else { this.fold(row.index); } } } }); xtable_7_submit = function() { var result = []; for(var i = 0; i < 100000; i++) { result.push({ name: "Alvin" + i, age: Math.floor(Math.random() * 100) + 1, location: "LA" }); } xtable_7.update(result); xtable_7.append("0", { name: "Alvin0.0", age: 15, location: "LA" }) xtable_7.append("2", { name: "Alvin2.0", age: 20, location: "LA" }) xtable_7.append("2.0", { name: "Alvin2.0.0", age: 30, location: "LA" }) xtable_7.append("4", { name: "Alvin4.0", age: 25, location: "LA" }) xtable_7.append("4", { name: "Alvin4.1", age: 27, location: "LA" }) xtable_7.append("7", { name: "Alvin7.0", age: 27, location: "LA" }) xtable_7.append("7.0", { name: "Alvin7.0.0", age: 23, location: "LA" }) xtable_7.append("7.0", { name: "Alvin7.0.1", age: 22, location: "LA" }) } });
<button class="btn small" onclick="xtable_7_submit()"> <i class="icon-play"></i> Run </button> <div id="xtable_7" class="xtable scroll" style="margin-top: 7px;"> <table class="table classic"> <thead> <tr> <th>Name</th> <th>Age</th> <th>Location</th> </tr> </thead> <tbody></tbody> </table> </div> <script id="tpl_row" type="text/template"> <tr> <td> <span style="padding-left: <!= row.depth * 20 !>px; cursor: pointer;"> <! if(row.children.length > 0) { !> <! if(row.type == "fold") { !>+<! } else { !>-<! } !> <! } !> </span> <!= name !> </td> <td><!= age !></td> <td><!= location !></td> </tr> </script> <script id="tpl_none" type="text/template"> <tr> <td colspan='3' class='none' align='center'>Data does not exist.</td> </tr> </script>
Result
API
Leave a comment
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus