ionic-modal-select icon indicating copy to clipboard operation
ionic-modal-select copied to clipboard

Data list not getting loaded when using has-search="true" attribute with data loaded from SQLITE

Open deepakrsakariya opened this issue 8 years ago • 2 comments

HTML

<button class="button button-positive" modal-select="" ng-model="voucherService.AccountName" modal-title="Select a account" options="AccountList" has-search="true" search-properties="['AccountName']"> Select it <div class="option"> {{option.AccountName}} </div> </button>

Controller

$scope.AccountList = [];
$scope.FillAccountList = function () { var query = "SELECT AccountID, AccountName FROM AccountMaster order by AccountName"; $cordovaSQLite.execute(db, query, []).then(function (res) { if (res.rows.length > 0) {
for (var i = 0; i < res.rows.length; i++) { $scope.AccountList.push({ AccountID: res.rows.item(i).AccountID, AccountName: res.rows.item(i).AccountName }); } } else { console.log("No results found"); } }, function (err) { console.error("error=>" + err); }); }; $scope.FillAccountList();

deepakrsakariya avatar Sep 12 '16 11:09 deepakrsakariya

Hi, sorry but it's difficult to reproduce this for me. Does your example work if the data is coming from another source?

bianchimro avatar Sep 14 '16 20:09 bianchimro

If data is predefined then it works. But when data are loaded in controller then it fails. You can try to push json data to a list and check.

deepakrsakariya avatar Sep 15 '16 04:09 deepakrsakariya