Guest User

Untitled

a guest
Jun 13th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.31 KB | None | 0 0
  1. self.ext_grid(:list) do | g |
  2.  
  3. g.per_page = 50
  4. g.label = 'Klanten'
  5. g.order = 'clients.number acs'
  6. g.config = {:closable=>true}
  7.  
  8. g.toolbar = Ext::Toolbar.new({}) do |t|
  9. t.button(:text=>'Nieuwe klant',:iconCls=>'new',:handler=>'function(){ExtApplication.window({caller: "<%= @grid.grid_id %>",height:"900px",title: "Nieuwe klant", resource:"<%= new_customer_client_path(@customer.id) %>"})}')
  10. t.button(:text=>'Details klant',:iconCls=>'details',:handler=>'function(){if (record = ExtApplication.grid_record({grid: "<%= @grid.grid_id %>"})) { ExtApplication.tab_open({caller: "<%= @grid.grid_id %>",title: "Details", resource:"<%= customer_clients_path(@customer.id) %>/" + record.data.id })}}')
  11. t.button(:text=>'Wijzigen klant',:iconCls=>'edit',:handler=>'function(){if (record = ExtApplication.grid_record({grid: "<%= @grid.grid_id %>"})) { ExtApplication.window({caller: "<%= @grid.grid_id %>",title: "Wijzigen klant", resource:"<%= customer_clients_path(@customer.id) %>/" + record.data.id + "/edit"})}}')
  12. t.button(:text=>'Verwijderen klant',:iconCls=>'delete', :handler=>'function(){ExtApplication.grid_delete_record({grid: "<%= @grid.grid_id %>",msg_confirm: "Weet u zeker dat u deze klant wilt verwijderen, ALLE CERTIFICATEN zullen ook verwijderd worden", resource: "<%= customer_clients_path(@customer.id) %>/", token: "<%= form_authenticity_token %>"})}')
  13.  
  14. t.add_right_align
  15.  
  16. t.button({:text=>'Maatwerk'},:customs)
  17.  
  18. t.button(:text=>'Certificaten',:iconCls=>'certificates',:handler=>'function(){if (record = ExtApplication.grid_record({grid: "<%= @grid.grid_id %>"})) { ExtApplication.tab_open({resource: "/customers/<%= @customer.id %>/certificates/client/" + record.data.id})}}')
  19.  
  20. t.button(:text=>'Exporteren',:iconCls=>'export',:handler=>'function(){ExtApplication.grid_export({grid: "<%= @grid.grid_id %>", report: "Klanten", url: "<%= report_path %>" + Ext.urlEncode(Ext.getCmp("<%= @grid.grid_id %>").getStore().lastOptions.params)})}')
  21. t.button(:text=>'Verversen',:iconCls=>'refresh', :handler=>'function(){Ext.getCmp("<%= @grid.grid_id %>").getStore().reload()}')
  22. end
  23.  
  24. g.context = Ext::Menu.new do | m |
  25.  
  26. m.item(:text=>'Wijzigen klant',:iconCls=>'edit',:handler=>'function(){if (record = ExtApplication.grid_record({grid: "<%= @grid.grid_id %>"})) { ExtApplication.window({caller: "<%= @grid.grid_id %>",title: "Wijzigen klant", resource:"<%= customer_clients_path(@customer.id) %>/" + record.data.id + "/edit"})}}')
  27. m.item(:text=>'Verwijderen klant',:iconCls=>'delete', :handler=>'function(){ExtApplication.grid_delete_record({grid: "<%= @grid.grid_id %>",msg_confirm: "Weet u zeker dat u deze klant wilt verwijderen, ALLE CERTIFICATEN zullen ook verwijderd worden", resource: "<%= customer_clients_path(@customer.id) %>/", token: "<%= form_authenticity_token %>"})}')
  28.  
  29.  
  30. end
  31.  
  32.  
  33. g.column('number',:text,{:width=>50}) do |c|
  34. c.label = 'Nummer'
  35. c.filter = true
  36. c.editor = Ext::Form::TextField.new({:allow_blank=>false})
  37. end
  38.  
  39.  
  40. g.column('name',:text) do |c|
  41. c.label = 'Naam'
  42. c.sort = {:field=>'clients.name'}
  43. c.filter = {:field =>'clients.name'}
  44. c.editor = Ext::Form::TextField.new({:allow_blank=>false})
  45. end
  46.  
  47. g.column('code',:text) do |c|
  48. c.label = 'Zoek code'
  49. c.filter = true
  50. c.editor = Ext::Form::TextField.new({:allow_blank=>false})
  51. end
  52.  
  53. g.column('address',:text) do |c|
  54. c.label = 'Adres'
  55. c.filter = true
  56. c.editor = Ext::Form::TextField.new({:allow_blank=>false})
  57. end
  58.  
  59. g.column('zip',:text) do |c|
  60. c.label = 'Postcode'
  61. c.filter = true
  62. c.editor = Ext::Form::TextField.new({:allow_blank=>false})
  63. end
  64.  
  65. g.column('city',:text) do |c|
  66. c.label = 'Plaats'
  67. c.filter = true
  68. c.editor = Ext::Form::TextField.new({:allow_blank=>false})
  69. end
  70.  
  71. g.column('telephone',:text) do |c|
  72. c.label = 'Telefoon'
  73. c.filter = true
  74. c.editor = Ext::Form::TextField.new({:allow_blank=>false})
  75. end
  76.  
  77. g.column('contact',:text) do |c|
  78. c.label = 'Contactpersoon'
  79. c.filter = true
  80. c.editor = Ext::Form::TextField.new({:allow_blank=>false})
  81. end
  82.  
  83.  
  84.  
  85. end
Add Comment
Please, Sign In to add comment