Methods
var grid = new FancyGrid({
...
});
...
grid.setTitle('new Title');
To use methods immediately after initialize widget read the following note.
If library was included fully
<script src="http://cdn.fancygrid.com/fancy.full.min.js"></script>
Than methods available immediately.
var grid = new FancyGrid({
...
});
grid.setTitle('new Title');
In all other cases it is not possible to use methods immediately.Library needs a moment to load required modules.
So it needs to wait till library would be inited.
For that use event
init
var grid = new FancyGrid({
...,
events: [{
init: function(){
gridInitedFn();
}
}],
...
});
function gridInitedFn(){
grid.setTitle('new Title');
}
To get link on widget from any place there are 2 approaches.
If it was set renderTo property than use FancyGrid.get('renderToID')
new FancyGrid({
renderTo: 'myGridReport',
...
});
function updateGridTitle(){
var grid = FancyGrid.get('myGridReport');
grid.setTitle('New Title');
}
Another approach to set id and to use Fancy.getWidget('gridId')
new FancyGrid({
id: 'myGrid',
...
});
function updateGridTitle(){
var grid = Fancy.getWidget('myGrid');
grid.setTitle('New Title');
}