Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3607318

Browse files
apijson-table: add hook_viewedit
1 parent 9a23815 commit 3607318

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

‎demo/apps/tables/templates/Tables/list.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<card>
88
<div style="min-height: 600px;">
99
{{if role!="ADMIN":}}
10-
<div class="alert alert-warning" role="alert">You should <a class="btn btn-primary btn-sm" href="{{=url_for('uliweb_apps.login.views.login')}}" role="button">login</a> with user <strong>admin</strong> to view all the tables</div>
10+
<div class="alert alert-warning" role="alert">You should <a class="btn btn-primary btn-sm" href="{{=url_for('uliweb_comapps.auth.login.views.login')}}" role="button">login</a> with user <strong>admin</strong> to view all the tables</div>
1111
{{pass #if}}
1212
<div id="app" class='box'>
1313
<div class="box-body">

‎uliweb_apijson/apijson/templates/vue/inc_apijson_table.html‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@
88
"custom_tcolumns_render_generator",
99
"hook_init", //hook_init(vm), will invoke in mounted()
1010
"hook_ajax_params", //hook_ajax_params(method,action,params), will invoke before ajax action
11-
"hook_add" //hook_add(vm), customize the add action
11+
"hook_add", //hook_add(vm), customize the add action
12+
"hook_viewedit" //hook_viewedit(vm), customize the add action
1213
],
1314
template: `<div>
1415
<div v-if="config_editable && config_add_fields!=null"><i-button type="primary" @click="add">Add</i-button> <br><br> </div>
1516
<Spin size="large" fix v-if="loading"></Spin>
1617
<i-table stripe border :columns="tcolumns" :data="tlist" @on-sort-change="table_on_sort_change"></i-table>
1718
<page :total="total" :page-size="query_count" :current.sync="current_page" :page-size-opts="[10, 20, 50, 100]" show-sizer @on-change="page_on_change" @on-page-size-change="page_on_page_size_change"></page>
1819
<modal v-model="modal_add" title="Add">
19-
<i-form @submit.native.prevent :label-width="80">
20+
<i-form @submit.native.prevent :label-width="100">
2021
<form-item v-for="item in add_items" :key="item.key" :label="item.title">
2122
<i-input v-if="item.component=='input'" v-model="item.value"></i-input>
2223
<checkbox v-if="item.component=='checkbox'" v-model="item.value"></checkbox>
@@ -31,7 +32,7 @@
3132
</div>
3233
</modal>
3334
<modal v-model="modal_view" :title="viewedit_label">
34-
<i-form @submit.native.prevent :label-width="80">
35+
<i-form @submit.native.prevent :label-width="100">
3536
<form-item v-for="item in viewedit_items" :key="item.key" :label="item.title">
3637
<i-input v-if="item.component=='input'" v-model="item.value" :readonly="!editable(item)"></i-input>
3738
<checkbox v-if="item.component=='checkbox'" v-model="item.value" :disabled="!editable(item)"></checkbox>
@@ -246,6 +247,11 @@
246247
})
247248
},
248249
show: function(params){
250+
if (this.hook_viewedit!=null) {
251+
this.hook_viewedit(this)
252+
return
253+
}
254+
249255
var row = params.row
250256
this.viewedit_items = []
251257
if (this.config_viewedit_fields!=null) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /