Get Drivers By Device ID

MuhHuz6 years ago

Hii Guys,

I can get Driver by driver_id with code below:

        var storeDrivers = Ext.getStore('Drivers');
        var drivers = storeDrivers.getById(1);
        console.log(drivers.id);
        console.log(drivers.get('name'));
        console.log(drivers.get('uniqueId'));

the relation between Device and Driver can we see in table tc_device_driver. the problem is, i could find any method in "store" to get Drivers by Device Id.

i just need get Drivers by Device_Id. Could someone tell me how can it done??

Anton Tananaev6 years ago

You can get driver id from position or event.

MuhHuz6 years ago

Hi Anton,
problem solved. i got the drivers object from API response (/api/drivers?deviceId={deviceId})

Thankyou