Pratik Vyas | c1e6e4c | 2011-06-08 14:37:15 +0530 | [diff] [blame] | 1 | //make tabs |
| 2 | |
| 3 | pscript.onload_customers = function() { |
| 4 | make_customer_tab($i('dcv_customers')); |
| 5 | } |
| 6 | |
| 7 | function make_customer_tab(parent) { |
| 8 | pscript.dcv_customers = new wn.widgets.DocColumnView('Customers', parent, |
| 9 | ['Customer Group', 'Customer', 'Contact'], { |
| 10 | 'Customer Group': { |
| 11 | show_fields : ['name'], |
| 12 | create_fields : ['name'], |
| 13 | search_fields : ['name'], |
| 14 | next_col: 'Customer' |
| 15 | }, |
| 16 | 'Customer': { |
| 17 | show_fields : ['name', 'customer_name'], |
| 18 | create_fields : ['name', 'customer_name'], |
| 19 | search_fields : ['customer_name'], |
| 20 | filter_by : ['Customer Group', 'customer_group'], |
| 21 | next_col: 'Contact' |
| 22 | }, |
| 23 | 'Contact': { |
| 24 | show_fields : ['name', 'first_name', 'last_name'], |
| 25 | create_fields : ['name','first_name', 'last_name'], |
| 26 | search_fields : ['first_name', 'last_name'], |
| 27 | conditions: ['is_customer=1'], |
| 28 | set_values: {'is_customer': 1 }, |
| 29 | filter_by : ['Customer', 'customer'] |
| 30 | }, |
| 31 | }) |
| 32 | } |
| 33 | |
| 34 | |