I placed scrollIntoView()
to make my grid scroll visible. When I add new grid in gridContainer so I using this method. This is working I can check from debugger.
my scrollIntoView()
grid.body.dom.scrollIntoView();
But once it reached in defer function it not scrollIntoView()
functioning. Can anybody please suggest how to skip this. What defer do and how to skip this. Also I am using grid.focus()
and again same thing is happening. Grid is coming into view but after come out from debugger no showing into view.
defer: function(fn, millis, scope, args, appendArgs) {
fn = Ext.Function.bind(fn, scope, args, appendArgs);
if (millis > 0) {
return setTimeout(function() {
if (Ext.elevateFunction) {
Ext.elevateFunction(fn);
} else {
fn();
}
}, millis);
}
fn();
return 0;
},
If the defer attribute is set, it specifies that the script is downloaded in parallel to parsing the page, and executed after the page has finished parsing. Note: The defer attribute is only for external scripts (should only be used if the src attribute is present).
Deferred statements are executed before the functions value is returned. In this case, the named return value i is incremented once the function completes, but before the value is returned to the calling statement in the main function.
Panics happen after a deferred statement is executed. the program ends after the panic statement is run.
Scripts with the defer attribute will prevent the DOMContentLoaded event from firing until the script has loaded and finished evaluating.
A workaround would be not to scroll to the component, but to use the card layout for the center container and display the new grid on an other card.
var centerCt; // reference to your center container
var centerLayout = centerContainer.getLayout();
var newGrid = Ext.create('Ext.grid.Panel', {});
centerCt.add(newGrid);
centerLayout.setActiveItem(newGrid);
I created a Sencha Fiddle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With