Commit 915ef261 authored by Evren Kutar's avatar Evren Kutar

typeahead custom search fix

parent 7281efe5
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
type="text" type="text"
autocomplete="off" autocomplete="off"
ng-model="$$value$$" ng-model="$$value$$"
uib-typeahead="item as item.name for item in getTitleMap($viewValue)" uib-typeahead="item as item.name for item in form.getTitleMap($viewValue)"
typeahead-wait-ms="500" typeahead-wait-ms="500"
typeahead-loading="loadingTitleMap" typeahead-loading="loadingTitleMap"
typeahead-on-select="form.onDropdownSelect($item, form.name)" typeahead-on-select="form.onDropdownSelect($item, form.name)"
......
...@@ -778,13 +778,16 @@ angular.module('ulakbus.formService', ['ui.bootstrap']) ...@@ -778,13 +778,16 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
scope.form[scope.form.indexOf(k)] = { scope.form[scope.form.indexOf(k)] = {
type: "template", type: "template",
title: v.title, title: v.title,
widget: v.widget,
getTitleMap: function (viewValue) { getTitleMap: function (viewValue) {
// v.view is where that value will looked up // v.view is where that value will looked up
var searchData = { var searchData = {
"url": v.wf, "form_params": {
"wf": v.wf, "url": v.wf,
"view": v.view, "wf": v.wf,
"query": viewValue "view": v.view,
"query": viewValue
}
}; };
generator.get_list(searchData).then(function (res) { generator.get_list(searchData).then(function (res) {
// response must be in titleMap format // response must be in titleMap format
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment