123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'user/user_ext/index' + location.search,
- add_url: 'user/user_ext/add',
- edit_url: 'user/user_ext/edit',
- del_url: 'user/user_ext/del',
- multi_url: 'user/user_ext/multi',
- import_url: 'user/user_ext/import',
- table: 'user_ext',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'cid', title: __('Cid')},
- {field: 'user_id', title: __('User_id')},
- {field: 'full_name', title: __('Full_name'), operate: 'LIKE'},
- {field: 'vocation', title: __('Vocation'), operate: 'LIKE'},
- {field: 'education', title: __('Education'), searchList: {"0":__('Education 0'),"1":__('Education 1'),"2":__('Education 2'),"3":__('Education 3'),"4":__('Education 4'),"5":__('Education 5'),"6":__('Education 6'),"7":__('Education 7'),"8":__('Education 8'),"9":__('Education 9')}, formatter: Table.api.formatter.normal},
- {field: 'tel', title: __('Tel'), operate: 'LIKE'},
- {field: 'address', title: __('Address'), operate: 'LIKE'},
- {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
- ]
- ]
- });
- // 为表格绑定事件
- Table.api.bindevent(table);
- },
- add: function () {
- Controller.api.bindevent();
- },
- edit: function () {
- Controller.api.bindevent();
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- }
- }
- };
- return Controller;
- });
|