1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- pageSize: 50, //调整分页大小为20
- pageList:[50],
- extend: {
- index_url: 'card/collect/index?id='+Config.id,
- add_url: 'card/collect/add',
- edit_url: 'card/collect/edit',
- del_url: 'card/collect/del',
- multi_url: 'card/collect/multi',
- table: 'card_collect',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- commonSearch:false,
- search:false,
- columns: [
- [
- {field: 'createdate', title: __('Date')},
- {field: 'c_id', title: __('C_id'),operate:false},
- {field: 'uv', title: __('Uv'),operate:false},
- {field: 'draws_uv', title: __('抽奖人数'),operate:false},
- {field: 'draws_pv', title: __('抽奖次数'),operate:false},
- {field: 'kandian', title: __('Kandian'),operate:false},
- ]
- ]
- });
- // 为表格绑定事件
- 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;
- });
|