Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
deepakrsakariya opened this issue Sep 12, 2016 · 2 comments

Comments

@deepakrsakariya
Copy link

deepakrsakariya commented Sep 12, 2016

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();

@bianchimro
Copy link
Member

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

@deepakrsakariya
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants