Skip to content
Merged

Sync #41

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
apijson-table: fix key and title problem in viewedit_items
  • Loading branch information
zhangchunlin committed Oct 12, 2019
commit 66d6d27a3668c0bfe11cb92cfe14be1baa22be15
8 changes: 4 additions & 4 deletions uliweb_apijson/apijson/templates/vue/inc_apijson_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,15 @@
}
}
else {
this.viewedit_items.push({title:"id",value:row.id,component:"input"})
this.viewedit_items.push({key:"id",title:"id",value:row.id,component:"input"})
var type2comp = {
"boolean":"checkbox"
}
for (var k in row){
if (k!="id" && k[0]!="_") {
var value = row[k]
var comp = type2comp[typeof value] || "input"
this.viewedit_items.push({title:k,value:value,component:comp})
this.viewedit_items.push({title:k,key:k,value:value,component:comp})
}
}
}
Expand Down Expand Up @@ -297,8 +297,8 @@
//only save modified fields
for (var k in thisp.viewedit_items) {
var d = thisp.viewedit_items[k]
if (d.title=="id"|| d.value!=row[d.title]) {
record_params[d.title] = d.value
if (d.key=="id"|| d.value!=row[d.key]) {
record_params[d.key] = d.value
}
}
if (thisp.role!="") {
Expand Down