How to get a value of a property in JSON array from extjs store? -
i have been trying dynamically generate check box value in json array json store.
{"modulecatogery":[{"menu":"msu"},{"menu":"schedule"},{"menu":"market_dashboard"},{"menu":"fe_reference"},{"menu":"qc_tools"},{"menu":"quickqc_voice"},{"menu":"quickqc_data"},{"menu":"marketqc_voice"},{"menu":"marketqc_data"},{"menu":"surgery"},{"menu":"file_inventory"},{"menu":"market_tracker"},{"menu":"drive_route_tracker"},{"menu":"tickets"},{"menu":"ticket_tracker"},{"menu":"assets"},{"menu":"metrics"},{"menu":"daily_status"},{"menu":"daily_processing"},{"menu":"weekly_workflow"},{"menu":"customer_questions"},{"menu":"kpi_performance_metrics"},{"menu":"collection_metrics"},{"menu":"operations_dashboard"},{"menu":"production_dashboard"},{"menu":"support_dashboard"},{"menu":"revenue_tracker"},{"menu":"deployment_tracker"},{"menu":"tickets"},{"menu":"ticket_tracker"},{"menu":"asset_management"},{"menu":"generate_shipment"},{"menu":"shipment_tracker"},{"menu":"resources"},{"menu":"schedule"},{"menu":"tracker"}]}
how can values associated "menu" in above json.? if can have each , every value array can dynamically assign these generate check box group.
thanks in advance.
you can iterate store:
store.each(function(record) { var menu = record.get('menu'); });
edit: since you're saying doesn't work dynamic data think iterate before has completed loading. sure handle iteration after load can following:
store.on({ //listener fires everytime after store has loaded load: function() { store.each(function(record) { var menu = record.get('menu'); //do stuff }); } }); store.load();
if want execute code first time store loads can use callback function on load()
method:
store.load(function() { store.each(function(record) { var menu = record.get('menu'); //do stuff }); });