PageRenderTime 42ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/demo/index.html

http://flexigrid.googlecode.com/
HTML | 381 lines | 368 code | 13 blank | 0 comment | 0 complexity | 338cd106a04a3b2d2bb778656b5d8442 MD5 | raw file
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <title>Flexigrid</title>
  6. <link rel="stylesheet" href="style.css" />
  7. <link rel="stylesheet" type="text/css" href="../css/flexigrid.pack.css" />
  8. <script type="text/javascript"
  9. src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
  10. <script type="text/javascript" src="../js/flexigrid.pack.js"></script>
  11. </head>
  12. <body>
  13. <img src="images/flash.png" alt="Flexigrid" width="960" height="483"
  14. usemap="#Map" style="visibility: hidden"
  15. onload="$(this).css({visibility:'visible',display:'none'}).fadeIn('slow');"
  16. title="Flexigrid" border="0" />
  17. <map name="Map" id="Map">
  18. <area shape="rect" coords="671,29,853,72" href="https://code.google.com/p/flexigrid/downloads/list?q=label:Featured"
  19. alt="Download" />
  20. </map>
  21. <h1 class="title" style="display: none">
  22. <strong>Flexigrid</strong> for jQuery<span
  23. style="font-size: 12px">by Paulo P. Marinas</span>
  24. </h1>
  25. <div class="update">
  26. <h2>What is it?</h2>
  27. <p>Lightweight but rich data grid with resizable columns and a
  28. scrolling data to match the headers, plus an ability to connect to an
  29. xml based data source using Ajax to load the content.</p>
  30. <p>Similar in concept with the Ext Grid only its pure jQuery love,
  31. which makes it light weight and follows the jQuery mantra of running
  32. with the least amount of configuration.</p>
  33. <h3>Features</h3>
  34. <ul>
  35. <li>Resizable columns</li>
  36. <li>Resizable height and width</li>
  37. <li>Sortable column headers</li>
  38. <li>Cool theme</li>
  39. <li>Can convert an ordinary table</li>
  40. <li>Ability to connect to an ajax data source (XML and JSON[new])</li>
  41. <li>Paging</li>
  42. <li>Show/hide columns</li>
  43. <li>Toolbar (new)</li>
  44. <li>Search (new)</li>
  45. <li>Accessible API</li>
  46. <li>Many more</li>
  47. </ul>
  48. </div>
  49. <div class="update">
  50. <h2>FAQ</h2>
  51. <ol>
  52. <li><div class="question">Where can I get support?</div>
  53. <div class="answer">
  54. Bugs can be reported
  55. <a href="http://code.google.com/p/flexigrid/">http://code.google.com/p/flexigrid/</a>, and
  56. our fantastic community support is available at
  57. <a href="http://groups.google.com/group/flexigrid/">http://groups.google.com/group/flexigrid/</a>.
  58. </div>
  59. </li>
  60. <li>
  61. <div class="question">What's recently changed and what are the known bugs?</div>
  62. <div class="answer">Go to
  63. <a href="http://code.google.com/p/flexigrid/issues/list">
  64. http://code.google.com/p/flexigrid/issues/list</a>
  65. </div>
  66. </li>
  67. <li><div class="question">What browsers does Flexigrid support?</div>
  68. <div class="answer">We support browsers IE6, Firefox 3, Opera 9,
  69. Safari 3, Chrome 7 and greater.</div>
  70. </li>
  71. <li><div class="question">Where can I contribute code or suggest a feature?</div>
  72. <div class="answer"><a href="http://code.google.com/p/flexigrid/">http://code.google.com/p/flexigrid/</a></div>
  73. </li>
  74. <li><div class="question">Can I use it for personal or commercial projects/modify it/hack it?</div>
  75. <div class="answer">Absolutely! Just make sure you adhere to either the <a href="http://jquery.org/license">GPL or MIT licenses</a>.</div>
  76. </li>
  77. <li><div class="question">Can I connect this to a form or add Parameters?</div>
  78. <div class="answer">Sure, check out our <a href="sample.html">sample code</a>
  79. to learn how.</div>
  80. </li>
  81. </ol>
  82. </div>
  83. <div class="update">
  84. <h2>Files you need</h2>
  85. <ul>
  86. <li><a href="http://www.jquery.com">jQuery</a></li>
  87. <li><a href="https://code.google.com/p/flexigrid/downloads/list?q=label:Featured">FlexiGrid Plugin Pack(32K)</a>
  88. (includes the js, css, and images)</li>
  89. </ul>
  90. </div>
  91. <div class="update">
  92. <h2>How to use</h2>
  93. <p>Check out the examples below, or
  94. <a href="http://code.google.com/p/flexigrid/source/">browse the source</a>.</p>
  95. </div>
  96. <h2>Example 1</h2>
  97. <p>
  98. The most basic example with the zero configuration, with a table
  99. converted into flexigrid (<a href="#"
  100. onclick="$(this).parent().next().toggle(); return false;">Show
  101. sample code</a>)
  102. </p>
  103. <div class="code">
  104. <pre>$('.flexme').flexigrid();</pre>
  105. </div>
  106. <table class="flexme1">
  107. <thead>
  108. <tr>
  109. <th width="100">Col 1</th>
  110. <th width="100">Col 2</th>
  111. <th width="100">Col 3 is a long header name</th>
  112. <th width="300">Col 4</th>
  113. </tr>
  114. </thead>
  115. <tbody>
  116. <tr>
  117. <td>This is data 1 with overflowing content</td>
  118. <td>This is data 2</td>
  119. <td>This is data 3</td>
  120. <td>This is data 4</td>
  121. </tr>
  122. <tr>
  123. <td>This is data 1</td>
  124. <td>This is data 2</td>
  125. <td>This is data 3</td>
  126. <td>This is data 4</td>
  127. </tr>
  128. <tr>
  129. <td>This is data 1</td>
  130. <td>This is data 2</td>
  131. <td>This is data 3</td>
  132. <td>This is data 4</td>
  133. </tr>
  134. <tr>
  135. <td>This is data 1</td>
  136. <td>This is data 2</td>
  137. <td>This is data 3</td>
  138. <td>This is data 4</td>
  139. </tr>
  140. <tr>
  141. <td>This is data 1</td>
  142. <td>This is data 2</td>
  143. <td>This is data 3</td>
  144. <td>This is data 4</td>
  145. </tr>
  146. <tr>
  147. <td>This is data 1</td>
  148. <td>This is data 2</td>
  149. <td>This is data 3</td>
  150. <td>This is data 4</td>
  151. </tr>
  152. <tr>
  153. <td>This is data 1</td>
  154. <td>This is data 2</td>
  155. <td>This is data 3</td>
  156. <td>This is data 4</td>
  157. </tr>
  158. <tr>
  159. <td>This is data 1</td>
  160. <td>This is data 2</td>
  161. <td>This is data 3</td>
  162. <td>This is data 4</td>
  163. </tr>
  164. <tr>
  165. <td>This is data 1</td>
  166. <td>This is data 2</td>
  167. <td>This is data 3</td>
  168. <td>This is data 4</td>
  169. </tr>
  170. <tr>
  171. <td>This is data 1</td>
  172. <td>This is data 2</td>
  173. <td>This is data 3</td>
  174. <td>This is data 4</td>
  175. </tr>
  176. <tr>
  177. <td>This is data 1</td>
  178. <td>This is data 2</td>
  179. <td>This is data 3</td>
  180. <td>This is data 4</td>
  181. </tr>
  182. <tr>
  183. <td>This is data 1</td>
  184. <td>This is data 2</td>
  185. <td>This is data 3</td>
  186. <td>This is data 4</td>
  187. </tr>
  188. </tbody>
  189. </table>
  190. <h2>Example 2</h2>
  191. <p>
  192. Table converted into flexigrid with height, and width set to auto,
  193. stripes remove. (<a href="#"
  194. onclick="$(this).parent().next().toggle(); return false;">Show
  195. sample code</a>)
  196. </p>
  197. <div class="code">
  198. <pre>$('.flexme2').flexigrid({height:'auto',striped:false});</pre>
  199. </div>
  200. <table class="flexme2">
  201. <thead>
  202. <tr>
  203. <th width="100">Col 1</th>
  204. <th width="100">Col 2</th>
  205. <th width="100">Col 3 is a long header name</th>
  206. <th width="300">Col 4</th>
  207. </tr>
  208. </thead>
  209. <tbody>
  210. <tr>
  211. <td>This is data 1 with overflowing content</td>
  212. <td>This is data 2</td>
  213. <td>This is data 3</td>
  214. <td>This is data 4</td>
  215. </tr>
  216. <tr>
  217. <td>This is data 1</td>
  218. <td>This is data 2</td>
  219. <td>This is data 3</td>
  220. <td>This is data 4</td>
  221. </tr>
  222. <tr>
  223. <td>This is data 1</td>
  224. <td>This is data 2</td>
  225. <td>This is data 3</td>
  226. <td>This is data 4</td>
  227. </tr>
  228. <tr>
  229. <td>This is data 1</td>
  230. <td>This is data 2</td>
  231. <td>This is data 3</td>
  232. <td>This is data 4</td>
  233. </tr>
  234. <tr>
  235. <td>This is data 1</td>
  236. <td>This is data 2</td>
  237. <td>This is data 3</td>
  238. <td>This is data 4</td>
  239. </tr>
  240. <tr>
  241. <td>This is data 1</td>
  242. <td>This is data 2</td>
  243. <td>This is data 3</td>
  244. <td>This is data 4</td>
  245. </tr>
  246. </tbody>
  247. </table>
  248. <h2>Example 3</h2>
  249. <p>
  250. Flexigrid with a dynamic data, paging, search, toolbar, and connected
  251. to an JSON file. (<a href="#"
  252. onclick="$(this).parent().next().toggle(); return false;">Show
  253. sample code</a>)
  254. </p>
  255. <div class="code">
  256. <pre>
  257. $("#flex1").flexigrid({
  258. url: 'post2.php',
  259. dataType: 'json',
  260. colModel : [
  261. {display: 'ISO', name : 'iso', width : 40, sortable : true, align: 'center'},
  262. {display: 'Name', name : 'name', width : 180, sortable : true, align: 'left'},
  263. {display: 'Printable Name', name : 'printable_name', width : 120, sortable : true, align: 'left'},
  264. {display: 'ISO3', name : 'iso3', width : 130, sortable : true, align: 'left', hide: true},
  265. {display: 'Number Code', name : 'numcode', width : 80, sortable : true, align: 'right'}
  266. ],
  267. buttons : [
  268. {name: 'Add', bclass: 'add', onpress : test},
  269. {name: 'Delete', bclass: 'delete', onpress : test},
  270. {separator: true}
  271. ],
  272. searchitems : [
  273. {display: 'ISO', name : 'iso'},
  274. {display: 'Name', name : 'name', isdefault: true}
  275. ],
  276. sortname: "iso",
  277. sortorder: "asc",
  278. usepager: true,
  279. title: 'Countries',
  280. useRp: true,
  281. rp: 15,
  282. showTableToggleBtn: true,
  283. width: 700,
  284. height: 200
  285. });
  286. </pre>
  287. </div>
  288. <table class="flexme3" style="display: none"></table>
  289. <script type="text/javascript">
  290. $('.flexme1').flexigrid();
  291. $('.flexme2').flexigrid({
  292. height : 'auto',
  293. striped : false
  294. });
  295. $(".flexme3").flexigrid({
  296. url : 'post-xml.php',
  297. dataType : 'xml',
  298. colModel : [ {
  299. display : 'ISO',
  300. name : 'iso',
  301. width : 40,
  302. sortable : true,
  303. align : 'center'
  304. }, {
  305. display : 'Name',
  306. name : 'name',
  307. width : 180,
  308. sortable : true,
  309. align : 'left'
  310. }, {
  311. display : 'Printable Name',
  312. name : 'printable_name',
  313. width : 120,
  314. sortable : true,
  315. align : 'left'
  316. }, {
  317. display : 'ISO3',
  318. name : 'iso3',
  319. width : 130,
  320. sortable : true,
  321. align : 'left',
  322. hide : true
  323. }, {
  324. display : 'Number Code',
  325. name : 'numcode',
  326. width : 80,
  327. sortable : true,
  328. align : 'right'
  329. } ],
  330. buttons : [ {
  331. name : 'Add',
  332. bclass : 'add',
  333. onpress : test
  334. }, {
  335. name : 'Delete',
  336. bclass : 'delete',
  337. onpress : test
  338. }, {
  339. separator : true
  340. } ],
  341. searchitems : [ {
  342. display : 'ISO',
  343. name : 'iso'
  344. }, {
  345. display : 'Name',
  346. name : 'name',
  347. isdefault : true
  348. } ],
  349. sortname : "iso",
  350. sortorder : "asc",
  351. usepager : true,
  352. title : 'Countries',
  353. useRp : true,
  354. rp : 15,
  355. showTableToggleBtn : true,
  356. width : 700,
  357. height : 200
  358. });
  359. function test(com, grid) {
  360. if (com == 'Delete') {
  361. confirm('Delete ' + $('.trSelected', grid).length + ' items?')
  362. } else if (com == 'Add') {
  363. alert('Add New Item');
  364. }
  365. }
  366. </script>
  367. </body>
  368. </html>