Jump to content

Javascript Execution after populating TUniStringGrid


mos

Recommended Posts

I have an application that populates a TUniStringGrid dynamically and the data is loaded based on the selected item from a specific list.

Which could be solved by any of the 2 situations below:

1. How can I execute a line of JS code? or
2. How can I hide a column completely? Since there is no Visible property in Columns (only used Columns.width := 0)

 

To elaborate:

1. The javascript is like this,

$('.test').each(function () {
    $(this).css('display', $(this).width() == 0 ? 'none' : '');
});

I've tried UniStringGrid.JSInterface.JSCode('code here');

But it doesn't run.

Alternatively, I've also used the ClientEvents.ExtEvents property, but this only works on the initial loading (placed on afterlayout) but when the data is changed, doesn't run anymore.

2. The columns appear as the image below

image.png.c2dc14a741ebf2c29dc9404fab006d76.png

Either solution to the 2 problems above would be great!

Thanks!

Link to comment
Share on other sites

2 minutes ago, Sherzod said:

Hi,

Maybe I don't fully understand what you want,

In addition..., you can also use this JS event:


function store.datachanged(sender, eOpts)
{
    //
}

 

Hi,

It's actually either one of the following:

1. Where or how can I run the javascript I need to run? or
2. How can I hide a column completely? There is no visible property in columns

Link to comment
Share on other sites

17 hours ago, Sherzod said:

Also, you can try this approach:


function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    columns[1].hidden=true;
    sender.getView().refresh();
}

 

Hi Sherzod,

It works! But as I change and change the data (via selecting from a list that reloads to grid), it wont work anymore? :huh:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...