PeterStaev / NativeScript-Drop-Down

A NativeScript DropDown widget.
Apache License 2.0
105 stars 65 forks source link

how do i get value of selected index drop down..? i iterate my Items={{menuList}} from Database.please help me to get selected index items value. thank you in advance #111

Closed akshaydoiphode closed 7 years ago

PeterStaev commented 7 years ago

@akshaydoiphode take a look at the readme there are examples how to work with Value list items.

akshaydoiphode commented 7 years ago

yeah..i saw that. but in my scenario i am getting my drop down list from my database..which is including of menu_id and menu name.. as dropdown concern i have to push total list that why i am getting problem in iterating my selected index menu_id and menu name.

On 29 June 2017 at 14:08, Peter Staev notifications@github.com wrote:

@akshaydoiphode https://github.com/akshaydoiphode take a look at the readme there are examples how to work with Value list items.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PeterStaev/NativeScript-Drop-Down/issues/111#issuecomment-311900811, or mute the thread https://github.com/notifications/unsubscribe-auth/AcZAQPlWuGFjujf6niVxhs2BSZ3Q3OiOks5sI2JsgaJpZM4OI5BK .

akshaydoiphode commented 7 years ago

@PeterStaev drop down in menucard.xml file is as

and i iterate my items by new Sqlite("KOTMASTER_db", function(err, db) {

        db.all('select menu_id,menu from menu_master', function(err, resultSet) {
        resultSet.forEach(function(row){
            viewModel.menuList.push(row[0]+' - '+row[1]);

});           

so i am not getting values from this
PeterStaev commented 7 years ago

You need to transform your value and display members from the DB to the format of the ValueList class. There is no other way.