I have a grid that pulls data from an ajax call and a video player. I'm trying to play the video after the data is loaded into the grid(DevExtreme.DataGrid). How do I do that?
var isLoaded = false;
$.ajax({
type: 'GET',
url: '?handler=GetData&StartTime=' + eventStartTime + '&EndTime=' + eventEndTime,
success: function (response) {
var obj = jQuery.parseJSON(response);
var _dataGrid = $("#eventGridData").dxDataGrid("instance");
_dataGrid.option('dataSource', obj);
_dataGrid.reload();
_dataGrid.refresh();
isLoaded = true;
},
error: function (error) {
alert("Error: " + error);
}
});
//this needs to kick in after the data is loaded into the grid and I do a refresh(see above)
if (isLoaded) {
//fetch matching video(by timestamp)
playbackPlayer.connect({
address: '127.0.0.1',
port: '25200',
timestart: timestart from the first record of the datagrid,
timeend: timeend from the first record of the datagrid
});
playbackPlayer.play();
}