Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
5.3 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*!
  2. * Ext JS Library 3.3.1
  3. * Copyright(c) 2006-2010 Sencha Inc.
  4. * licensing@sencha.com
  5. * http://www.sencha.com/license
  6. */
  7. Ext.onReady(function() {
  8. var store = new Ext.data.ArrayStore({
  9. proxy : new Ext.data.MemoryProxy(),
  10. fields : ['hasEmail', 'hasCamera', 'id', 'name', 'price', 'screen', 'camera', 'color', 'type', 'reviews', 'screen-size'],
  11. sortInfo: {
  12. field : 'name',
  13. direction: 'ASC'
  14. }
  15. });
  16. store.loadData([
  17. [true, false, 1, "LG KS360", 54, "240 x 320 pixels", "2 Megapixel", "Pink", "Slider", 359, 2.400000],
  18. [true, true, 2, "Sony Ericsson C510a Cyber-shot", 180, "320 x 240 pixels", "3.2 Megapixel", "Future black", "Candy bar", 11, 0.000000],
  19. [true, true, 3, "LG PRADA KE850", 155, "240 x 400 pixels", "2 Megapixel", "Black", "Candy bar", 113, 0.000000],
  20. [true, true, 4, "Nokia N900 Smartphone 32 GB", 499, "800 x 480 pixels", "5 Megapixel", "( the image of the product displayed may be of a different color )", "Slider", 320, 3.500000],
  21. [true, false, 5, "Motorola RAZR V3", 65, "96 x 80 pixels", "0.3 Megapixel", "Silver", "Folder type phone", 5, 2.200000],
  22. [true, true, 6, "LG KC910 Renoir", 242, "240 x 400 pixels", "8 Megapixel", "Black", "Candy bar", 79, 0.000000],
  23. [true, true, 7, "BlackBerry Curve 8520 BlackBerry", 299, "320 x 240 pixels", "2 Megapixel", "Frost", "Candy bar", 320, 2.640000],
  24. [true, true, 8, "Sony Ericsson W580i Walkman", 120, "240 x 320 pixels", "2 Megapixel", "Urban gray", "Slider", 1, 0.000000],
  25. [true, true, 9, "Nokia E63 Smartphone 110 MB", 170, "320 x 240 pixels", "2 Megapixel", "Ultramarine blue", "Candy bar", 319, 2.360000],
  26. [true, true, 10, "Sony Ericsson W705a Walkman", 274, "320 x 240 pixels", "3.2 Megapixel", "Luxury silver", "Slider", 5, 0.000000],
  27. [false, false, 11, "Nokia 5310 XpressMusic", 140, "320 x 240 pixels", "2 Megapixel", "Blue", "Candy bar", 344, 2.000000],
  28. [false, true, 12, "Motorola SLVR L6i", 50, "128 x 160 pixels", "", "Black", "Candy bar", 38, 0.000000],
  29. [false, true, 13, "T-Mobile Sidekick 3 Smartphone 64 MB", 75, "240 x 160 pixels", "1.3 Megapixel", "", "Sidekick", 115, 0.000000],
  30. [false, true, 14, "Audiovox CDM8600", 5, "", "", "", "Folder type phone", 1, 0.000000],
  31. [false, true, 15, "Nokia N85", 315, "320 x 240 pixels", "5 Megapixel", "Copper", "Dual slider", 143, 2.600000],
  32. [false, true, 16, "Sony Ericsson XPERIA X1", 399, "800 x 480 pixels", "3.2 Megapixel", "Solid black", "Slider", 14, 0.000000],
  33. [false, true, 17, "Motorola W377", 77, "128 x 160 pixels", "0.3 Megapixel", "", "Folder type phone", 35, 0.000000],
  34. [true, true, 18, "LG Xenon GR500", 1, "240 x 400 pixels", "2 Megapixel", "Red", "Slider", 658, 2.800000],
  35. [true, false, 19, "BlackBerry Curve 8900 BlackBerry", 349, "480 x 360 pixels", "3.2 Megapixel", "", "Candy bar", 21, 2.440000],
  36. [true, false, 20, "Samsung SGH U600 Ultra Edition 10.9", 135, "240 x 320 pixels", "3.2 Megapixel", "", "Slider", 169, 2.200000]
  37. ]);
  38. var dataview = new Ext.DataView({
  39. store: store,
  40. tpl : new Ext.XTemplate(
  41. '<ul>',
  42. '<tpl for=".">',
  43. '<li class="phone">',
  44. '<img width="64" height="64" src="images/phones/{[values.name.replace(/ /g, "-")]}.png" />',
  45. '<strong>{name}</strong>',
  46. '<span>{price:usMoney} ({reviews} Review{[values.reviews == 1 ? "" : "s"]})</span>',
  47. '</li>',
  48. '</tpl>',
  49. '</ul>'
  50. ),
  51. plugins : [
  52. new Ext.ux.DataViewTransition({
  53. duration : 550,
  54. idProperty: 'id'
  55. })
  56. ],
  57. id: 'phones',
  58. itemSelector: 'li.phone',
  59. overClass : 'phone-hover',
  60. singleSelect: true,
  61. multiSelect : true,
  62. autoScroll : true
  63. });
  64. var phoneSlider = new Ext.Slider({
  65. width : 300,
  66. minValue: 0,
  67. maxValue: 500,
  68. values : [80, 320],
  69. plugins : [
  70. new Ext.slider.Tip({
  71. getText: function(thumb) {
  72. var largest = Ext.max(store.collect('price', false, true));
  73. return String.format('<b>${0}</b>', thumb.value);
  74. }
  75. })
  76. ],
  77. listeners: {
  78. change: {
  79. buffer: 70,
  80. fn : filterData
  81. }
  82. }
  83. });
  84. new Ext.Panel({
  85. title: 'Animated DataView',
  86. layout: 'fit',
  87. items : dataview,
  88. height: 615,
  89. width : 800,
  90. tbar : [
  91. 'Filter phone price:', ' ',
  92. phoneSlider
  93. ],
  94. renderTo: 'docbody'
  95. });
  96. //filters the store based on the current slider values
  97. function filterData(slider) {
  98. var values = slider.getValues();
  99. store.filter([{
  100. fn: function(record) {
  101. return record.get('price') >= values[0] && record.get('price') <= values[1];
  102. }
  103. }]);
  104. store.sort('name', 'ASC');
  105. };
  106. //perform initial filter
  107. filterData(phoneSlider);
  108. });