binary direct list action with some customized code

teldrive 04 Apr, 2015
Hi
let me know if can do this:
i have some binary field 'model.field1'='0' that changes to 'model.field1'='1' directly over the cc list without problems,
I need some php code that checks if max number of 'model.field1'='1' has been achieved in order to allow or not that this record will be changed
let me know if i can do this with php or JavaScript code and some clue how intercept this action

Thanks in advance
Max_admin 20 Apr, 2015
Hi Teldrive,

Please try to change the binary link to point to a new custom action, say "custom", now config this action to point to a custom form event, say "custom_event".

Then in the "custom event" you can do your check using a "db read" (pass any params you need in the link) and execute the toggle using a "Connection action", write "toggle" in the "action name" field.

I didn't try this before but this is how it should be working, let me know if it doesn't.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
teldrive 21 Apr, 2015
Hi Max, thanks by reply
let me ask you some additional help, how can i " change the binary link to point to a new custom action,? " the rest of programing seems to be easier
Max_admin 22 Apr, 2015
Hi Teldrive,

Just copy the binary link before your disable it, and change the "act" param value in the url, use your new action's name.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
teldrive 23 Apr, 2015
Answer
Hi Max, thanks i understood the idea , i replaced binary by this php code and it works😀
model.field:return ($row['model']['field']=='1') ? "<a href='/es/component/chronoconnectivity5/?cont=lists&act=test&ccname=cc_list&gcb={model.id}'><img src='/libraries/cegcore/assets/images/enabled.png'/></a>"  : "<a href='/es/component/chronoconnectivity5/?cont=lists&act=test&ccname=cc_list&gcb={model.id}'><img src='/libraries/cegcore/assets/images/disabled.png'/></a>";
This topic is locked and no more replies can be posted.