Dynamic grid inside nextmatch?

classic Classic list List threaded Threaded
3 messages Options
filkaris filkaris
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Dynamic grid inside nextmatch?

Hello everyone.

I am trying to place a <grid> on the header_row of a nextmatch
I want this grid to get dynamic data, so in the .xet file I use this as id="${row}[actual_id]"

However, even though this works on etemplate in general, and is translated to 0[actual_id], 1[actual_id] etc.
when it's inside nextmatch it stays ${row}[actual_id].

Because of this, I can't populate the grid with data. Neither from PHP content (array [0] => row, [1] => row etc.),
neither from JS ( app.appname.et2.getWidgetById('grid').set_value({ content: [ {actual_id : 25}, {actual_id : 20} ], sel_options:[]}) )

Both methods work outside nextmatch though.

Is there a way to have a simple grid with data inside nextmatch header_row?
Thanks!
Nathan Gray Nathan Gray
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dynamic grid inside nextmatch?


On 15 March 2017 at 10:42, filkaris <[hidden email]> wrote:
Hello everyone.

I am trying to place a <grid> on the header_row of a nextmatch
I want this grid to get dynamic data, so in the .xet file I use this as
id="${row}[actual_id]"...
Because of this, I can't populate the grid with data. Neither from PHP
content (array [0] => row, [1] => row etc.),
neither from JS ( app.appname.et2.getWidgetById('grid').set_value({ content:
[ {actual_id : 25}, {actual_id : 20} ], sel_options:[]}) )

Both methods work outside nextmatch though.

Is there a way to have a simple grid with data inside nextmatch header_row?
Thanks!

Your JS attempt looks correct.  The grid has some exceptions for nextmatch that may be causing you problems.  It may not be possible to get around them, but every widget supports a 'parent_node' attribute.  You can try putting your grid in a different place, like the end of the template and putting a placeholder box (with different ID) where you want it.  Then set the parent_node on the grid to make it show up in the box.
 
Nathan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
eGroupWare-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
filkaris filkaris
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dynamic grid inside nextmatch?

Thank you Nathan,

I ended up placing the grid above the nextmatch, but I will keep in mind the parent_node for the future.

I'm actually not just using a grid, but a tabbox, that uses one template for all the tabs, and feeding different content each time.
So since things are a bit complicated I'll just stay outside nextmatch.

Thanks again!
Loading...