这是源码,可以渲染,但是却自动以name
这个字段来搜索,而我的表里没有这个字段,请问怎么改成其他搜索字段呢?
<input id="c-csmmeet_building_id" data-rule="required" data-source="teacher/user/index" class="form-control selectpage" name="row[csmmeet_building_id]" type="text" value="">
两种方法:
1.HTML里改:
添加data-field="xxx"
来指定搜索字段,如:
<input id="c-csmmeet_building_id" data-rule="required" data-source="teacher/user/index" class="form-control selectpage" data-field="nickname" name="row[csmmeet_building_id]" type="text" value="">
2.通过js来渲染:
$("#hospital").addClass("selectpage").data("source", "hospital/index/index").data("primaryKey", "hospital_id").data("field", "hospital_name").data("orderBy", "hospital_id desc");