javascript
JS 搜索 --下拉列表
?來源:http://boris-song.javaeye.com/blog/228327
1. var ds_getYear = new Ext.data.Store({ 2. autoLoad : true, 3. proxy : new Ext.data.HttpProxy({ 4. url : '/getFrYear/', 5. method : 'POST' 6. }), 7. reader : new Ext.data.JsonReader({ 8. root : 'yearList', 9. fields : [{ 10. name : 'yearMap' 11. }] 12. }) 13. }); 14. var ds_getMonth = new Ext.data.Store({ 15. autoLoad : true, 16. proxy : new Ext.data.HttpProxy({ 17. url : '/getFrMonth/', 18. method : 'POST' 19. }), 20. reader : new Ext.data.JsonReader({ 21. root : 'monthList', 22. fields : [{ 23. name : 'monthMap' 24. }, { 25. name : 'monthSelect' 26. }] 27. }) 28. }); 29. var fitDateSelect_Year = new Ext.form.ComboBox({ 30. id : 'yearSelect', 31. title : '年份', 32. width : 90, 33. store : ds_getYear, 34. displayField : 'yearMap', 35. valueField : 'yearMap', 36. typeAhead : true, 37. loadingText : '載入中...', 38. shadow : true, 39. mode : 'local', 40. hiddenName : 'year', 41. emptyText : '請選擇年份', 42. selectOnFocus : true, 43. forceSelection : true, 44. editable : true, 45. value : Ext.util.Format.date(new Date(), 'Y'), 46. triggerAction : 'all' 47. }); 48. var fitDateSelect_Month = new Ext.form.ComboBox({ 49. title : '月份', 50. id : 'monthSelect', 51. width : 90, 52. store : ds_getMonth, 53. displayField : 'monthMap', 54. valueField : 'monthMap', 55. typeAhead : true, 56. loadingText : '載入中...', 57. shadow : true, 58. mode : 'local', 59. hiddenName : 'month', 60. emptyText : '請選擇月份', 61. selectOnFocus : true, 62. forceSelection : true, 63. editable : true, 64. value : Ext.util.Format.date(new Date(), 'm'), 65. triggerAction : 'all' 66. }); 67. 68. var grid = new xg.EditorGridPanel({ 69. title : "報表", 70. ds : ds, 71. cm : cm, 72. tbar : [fitDateSelect_Year, fitDateSelect_Month, { 73. text : '查詢', 74. handler : function() { 75. ds.load({ 76. params : { 77. year : Ext.get('yearSelect').dom.value, 78. month : Ext.get('monthSelect').dom.value 79. } 80. }); 81. } 82. }], 83. 84. frame : true, 85. width : 1100, 86. height : 450, 87. clicksToEdit : 1, 88. collapsible : true, 89. animCollapse : true, 90. trackMouseOver : false, 91. enableColumnMove : true, 92. iconCls : 'icon-grid' 93. });
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的JS 搜索 --下拉列表的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Mac OS X在某应用的窗口间进行切换
- 下一篇: Mac OS X的F9怎么用