PageRenderTime 25ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/aoliz/core/admin/view/product/spec_select.html

http://phpfor.googlecode.com/
HTML | 138 lines | 100 code | 38 blank | 0 comment | 0 complexity | 584aae0443f2b4aeb024c280a4add3f5 MD5 | raw file
  1. <div class='tableform' style="margin:2px;" id='spec_select'>
  2. <table width="100%" border="0" cellspacing="0" cellpadding="0" >
  3. <tr>
  4. <td style=" vertical-align:top;" width='35%' >
  5. <h4><{t}>?????<{/t}></h4>
  6. <div class="division" style="margin:2px;">
  7. <p style="margin:3px; padding:0"><input type='text' class='spec_select_search shadow' id='spec-select-search-input' style='display:none;' value='????...' /></p>
  8. <div class='spec_search' style='height:240px;overflow:auto;'>
  9. <ul class='g-menu-sec'>
  10. <{foreach from=$specs item=sItem}>
  11. <li><label><input name='spec_select' type='radio' value="<{$sItem.spec_id}>" autocomplete='off'/><{$sItem.spec_name|escape:"html"}></label><{if $sItem.spec_memo}> [<{$sItem.spec_memo}>]<{/if}></li>
  12. <{/foreach}>
  13. </ul>
  14. </div>
  15. </div>
  16. <div style="text-align:center"> ??????????
  17. <span class="sysiconBtn addorder addspec"><{t}>?????<{/t}></span></div>
  18. </td>
  19. <td style="vertical-align:top;" width='70%' >
  20. <h4><{t}>?????<{/t}></h4>
  21. <div class="division" style="margin:2px;">
  22. <div id='sel-spec-value-area' class="clearfix">
  23. <div class='notice'><{t}>???????????<{/t}></div>
  24. </div>
  25. </div>
  26. </td>
  27. </tr>
  28. <tr>
  29. </tr>
  30. </table>
  31. <div class='mainFoot' style='width:60px;height:40px;margin:0 auto;'>
  32. <div class="table-action">
  33. <{button label="??"}>
  34. </div>
  35. </div>
  36. </div>
  37. <script>
  38. void function(){
  39. $E('#spec_select .addspec').addEvent('click',function(){
  40. var dialog=this.getParent('.dialog');
  41. var addSpecdialog= new Dialog('index.php?ctl=goods/specification&act=addSpec',{title:'????',onLoad:function(){
  42. /* this.dialog.getElement('.nav-bar').remove();*/
  43. var specAddform=this.dialog.getElement('form');
  44. specAddform.removeEvents('submit').addEvent('submit',function(e){
  45. e.stop();
  46. W.page(specAddform.action,{data:specAddform,method:specAddform.method,update:'messagebox',onComplete:function(){
  47. addSpecdialog.close();
  48. dialog.retrieve('instance').reload();
  49. }});
  50. });
  51. }});
  52. });
  53. $E('#spec_select .btn').addEvent('click',function(){
  54. var dialog=this.getParent('.dialog');
  55. if(!dialog)return;
  56. var selected=$ES('#spec_select .g-menu-sec li').filter(function(li){
  57. return li.getElement('input[type=radio]').checked;
  58. });
  59. if(selected.length>0){
  60. dialog.retrieve('callback',$empty)(selected[0].getElement('input').value,selected[0].getElement('label').get('text'));
  61. }
  62. dialog.getElement('.dialog-btn-close').fireEvent('click');
  63. });
  64. $$('#spec_select .g-menu-sec input[name^=spec_select]').addEvent('click',function(sel){
  65. var selSId = this.get('value');
  66. new XHR({
  67. data:'spec_id='+selSId,
  68. onRequest:function(){
  69. $('sel-spec-value-area').setText("loading...");
  70. },
  71. onSuccess:function(rs){
  72. $('sel-spec-value-area').set('html',rs);
  73. }
  74. }).send('index.php?ctl=goods/specification&act=selSpec');
  75. });
  76. if($ES('#spec_select .g-menu-sec li').length>50){
  77. $('spec-select-search-input').show().addEvent('focus',function(){
  78. if(this.value=='????...')
  79. this.value='';
  80. }).addEvent('keyup',function(){
  81. var value=this.value;
  82. if(!!value){
  83. var result=$ES('#spec_select .g-menu-sec li').filter(function(li){
  84. li.alt=li.alt||"";
  85. li.title=li.title||"";
  86. return li.alt.contains(value.trim())
  87. ||li.title.contains(value.trim())
  88. ||$E('label',li).getText().contains(value.trim());
  89. });
  90. if(result.length>0){
  91. $ES('#spec_select .g-menu-sec li').hide();
  92. $$(result).show();
  93. return;
  94. }
  95. }
  96. $ES('#spec_select .g-menu-sec li').show();
  97. });
  98. }
  99. }();
  100. </script>