Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- self.ext_grid(:list) do | g |
- g.per_page = 50
- g.label = 'Klanten'
- g.order = 'clients.number acs'
- g.config = {:closable=>true}
- g.toolbar = Ext::Toolbar.new({}) do |t|
- 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) %>"})}')
- 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 })}}')
- 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"})}}')
- 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 %>"})}')
- t.add_right_align
- t.button({:text=>'Maatwerk'},:customs)
- 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})}}')
- 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)})}')
- t.button(:text=>'Verversen',:iconCls=>'refresh', :handler=>'function(){Ext.getCmp("<%= @grid.grid_id %>").getStore().reload()}')
- end
- g.context = Ext::Menu.new do | m |
- 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"})}}')
- 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 %>"})}')
- end
- g.column('number',:text,{:width=>50}) do |c|
- c.label = 'Nummer'
- c.filter = true
- c.editor = Ext::Form::TextField.new({:allow_blank=>false})
- end
- g.column('name',:text) do |c|
- c.label = 'Naam'
- c.sort = {:field=>'clients.name'}
- c.filter = {:field =>'clients.name'}
- c.editor = Ext::Form::TextField.new({:allow_blank=>false})
- end
- g.column('code',:text) do |c|
- c.label = 'Zoek code'
- c.filter = true
- c.editor = Ext::Form::TextField.new({:allow_blank=>false})
- end
- g.column('address',:text) do |c|
- c.label = 'Adres'
- c.filter = true
- c.editor = Ext::Form::TextField.new({:allow_blank=>false})
- end
- g.column('zip',:text) do |c|
- c.label = 'Postcode'
- c.filter = true
- c.editor = Ext::Form::TextField.new({:allow_blank=>false})
- end
- g.column('city',:text) do |c|
- c.label = 'Plaats'
- c.filter = true
- c.editor = Ext::Form::TextField.new({:allow_blank=>false})
- end
- g.column('telephone',:text) do |c|
- c.label = 'Telefoon'
- c.filter = true
- c.editor = Ext::Form::TextField.new({:allow_blank=>false})
- end
- g.column('contact',:text) do |c|
- c.label = 'Contactpersoon'
- c.filter = true
- c.editor = Ext::Form::TextField.new({:allow_blank=>false})
- end
- end
Add Comment
Please, Sign In to add comment