PDA

View Full Version : [CLOSED] Listeners Mask



rbtceo
May 05, 2014, 6:32 AM
Hello everyone,

I am going through a grid on client click and changing every cell's value on client side. It takes time.

Is there any way to show a mask on that event?

Thank you.

The script:


<ext:Button runat="server" Text="Text">
<Listeners>
<Click Handler="selectAll();" />
</Listeners>
</ext:Button>



<ext:XScript ID="XScript1" runat="server">

<script>

function selectAll() {

var grid = #{myGrid},
columns = grid.columns;

var store = grid.getStore();

Ext.each(columns, function(column, j) {
store.each(function(record) {
record.set(column.text, true);
});
});
}
</script>

</ext:XScript>

Daniil
May 05, 2014, 7:37 AM
Hi @rbtceo,

Masking doesn't make perfect sense for client side operations.

I have another suggestion - improving the performance of what you are doing.

Please try the following:

function selectAll() {
var grid = #{myGrid},
columns = grid.columns,
store = grid.getStore();

Ext.suspendLayouts();
Ext.each(columns, function(column, j) {
store.each(function(record) {
record.set(column.dataIndex, true);
});
});
Ext.resumeLayouts(true);
}
or

function selectAll() {
var grid = #{myGrid},
columns = grid.columns,
store = grid.getStore();

Ext.each(columns, function(column, j) {
store.each(function(record) {
record.data[column.dataIndex] = true;
});
});

grid.getView().refresh();
}

rbtceo
May 05, 2014, 8:01 AM
It works visibly faster.
Thank you.

But it still takes 2 or 3 seconds.
From the client view - "it is freezing" for 2-3 seconds.

It means I still need a mask or something for that time.

Daniil
May 05, 2014, 3:19 PM
You can try with

Ext.net.Mask.show({ el: #{myGrid}.view.el });
and

Ext.net.Mask.hide();

rbtceo
May 06, 2014, 2:28 AM
Hello Daniil,

The mask doesn't appear.
I am using Master page and content pages.
Ext.Net 2.5.0

geoffrey.mcgill
May 06, 2014, 3:02 AM
The code provide by @daniil works correctly for the scenario you described originally.

If you cannot provide an adequate sample demonstrating how to reproduce the problem, then we are unable to provide any further assistance.

Please review the following Guidelines before posting in the forums again.

http://forums.ext.net/showthread.php?3440-Forum-Guidelines-For-Posting-New-Topics

http://forums.ext.net/showthread.php?10205-More-Information-Required

rbtceo
May 06, 2014, 4:03 AM
Agree.

The mask is fine.
Something is wrong in my code.

The thread can marked as closed.

Thank you.