NetTalk Central

Author Topic: conditionally hide/show inline button in browse  (Read 4106 times)

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
conditionally hide/show inline button in browse
« on: February 14, 2018, 12:50:54 PM »
I'm looking for a way to conditionally hide/show inline buttons (type other).   I need this at the cell level.  Using the condition entry on the template affects all buttons in the column. 
I'm looking at p_web.jQuery() to see if that is the way to go.  For example,

packet=p_web.jQuery('somedivid', 'someaction', loc:options)

Still don't have the id, action and option setting after looking at the browse source.  Can anyone help?

Thanks,

Jeff

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: conditionally hide/show inline button in browse
« Reply #1 on: February 15, 2018, 03:53:07 AM »
Hi Jeff,

Me again.

I do this, but maybe there is a better way (I'm in NT10 but most of my work was built in NT7).

I create a column which is a local variable and I use the "Value:: routine for" for my local variable to create the necessary code to create a button. Make sure you do not set a picture for the local variable in the column definition.

Here is a snipit of code that creates a button:

lAction = '<button type="button" name="view_btn" class="MiniButton" onclick="ntd.push(''TrustReceipt'','''','''',1,5,null,''trusttransaction'','''&CLIP(p_web.AddBrowseValue('TrustTransaction','Trust',TRU:SysKey))&''','''',0,'''','''','''',''View Receipt'',''trusttransaction'','''');">View</button>'


TrustReceipt is my form. I've made sure the record in the Trust file is in memory so the AddBrowseValue function will work. lAction is my local variable that is a column on the browse.

If I wrap this in a condition it will only be created if my condition is true, I could also check a condition and create different buttons for different reasons.

Regards
Bill