Forums

How to build sort column in Custom rather than Table view.

NickOg 26 Jan, 2015
Hi

I am finding it necessary to use the Custom rather than Table view for a Connectivity job. I need to add a sortable column. Looking at a simple connection - MasterConstants - I see that the link references a Chronoform 5 of the same name as the connection.
http://www.devj3c201.pmhu3a.org.au/chronoformsv5/master-contants?act=index&orderfld=mdlMaster.decCost&orderdrc=asc


I have not created that form - it does not exist.
I tried to just cut, paste and modify that code to suit my 'target' connection but it crashes as it ca;t find the form.

Long and short of it - how do i add a sortable column to a custom connection?

Regards

Nick
GreyHead 28 Jan, 2015
Hi Nick,

Can you not add the column to the Sortables box - I thought that still worked in a Custom listing?

Bob
NickOg 19 Feb, 2015
Hi Bob

Lord I left that a long time to reply. It would appear not. I have added the name="fltr[mdlListMbrReceipts][paidBy]" to the header but am looking for an equivalent sort version.

Nick
NickOg 27 Feb, 2015
Anyone able to help here?
GreyHead 03 Mar, 2015
Hi Nick,

Have you tried the entry in the Sortables box?

Bob
NickOg 03 Mar, 2015
Hi Bob

I didn't make that clear did I? Yes - I have a column in the sortables box but no good. I have the same situation with two different connections.

Nick
Max_admin 04 Mar, 2015
Answer
Hi Nick,

If you have Model.field in the columns list, and Model.field in the sortable box, then {Model.field} in the header code would display a sortable link

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
NickOg 04 Mar, 2015
Brilliant! Thanks Max. Works a treat.
Nick
NickOg 06 Mar, 2015
Hi Max

Following on from that - can one use the same syntax and function for other fields/function? For example, if I use a field {mdlListCourseReceipts.accountPaid} in a custom table

  <td class='njjoCenter'>{mdlListCourseReceipts.accountPaid}</td>


and the accompanying HTML

mdlListCourseReceipts.accountPaid:array('Yes'=>"<I class='fa fa-check'></i>",'No'=>"<I class='fa fa-times'></i>")


plus the binary field . Should that toggle the field?
It doesn't and before i go chase my error i thought that I would just ask.😲
Nick
Max_admin 06 Mar, 2015
Hi Nick,

The HTML box will override the output of all boxes, so if you set your field there then its useless to have it in any other box.

Also, the binary field should have either 0 or 1, nothing else.

What you can do is to use the HTML box but build the links to the "toggle" action yourself, the toggle action accepts a "val" parameter which specifies the new value to be set when the action is executed, just test this with a binary field and you can find out how it works!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
NickOg 06 Mar, 2015
Thanks Max
Got it. I will give it a go.
Nick
NickOg 07 Mar, 2015
Hi Max
Progress - I have the binary toggle nearly working. I thought I would start there.

  <td class='njjoCenter'>{mdlListCourseReceipts.accountPaid}</td>

and that same field in the binary box. I have all permissions set for the user.
The toggle
a href="/index.php?option=com_chronoconnectivity5&cont=lists&act=toggle&ccname=lisCourseReceiptsPick&gcb={mdlListCourseReceipts.}&val=0&fld=accountPaid&model=mdlListCourseReceipts&Itemid=390">
<img src="http://www.devj3c105.pmhu3a.org.au/libraries/cegcore/assets/images/enabled.png" kasperskylab_antibanner="on">
</a>


clearly works but I am getting an "Update Failed' Message every time I try the update. (I noticed that Kaspersky anti-banner but no different if I disable that)

Is there some way of checking the update SQL or debugging that? Or have I missed something basic?

Regards

Nick
NickOg 07 Mar, 2015
Further to

What you can do is to use the HTML box but build the links to the "toggle" action yourself, the toggle action accepts a "val" parameter which specifies the new value to be set when the action is executed, just test this with a binary field and you can find out how it works!


Can you point me to an example of setting up this toggle action, please?
Or do you mean I should include code like that generated in the toggle action as per example above?

That is
<a href="/index.php?option=com_chronoconnectivity5&cont=lists&act=toggle&ccname=lisCourseReceiptsPick&gcb={mdlListCourseReceipts.}&val=0&fld=accountPaid&model=mdlListCourseReceipts&Itemid=390"><img src="http://www.devj3c105.pmhu3a.org.au/libraries/cegcore/assets/images/enabled.png" kasperskylab_antibanner="on"></a>


Thanks again

Nick
Max_admin 08 Mar, 2015
Your link has a missing part:
gcb={mdlListCourseReceipts.}


You didn't add the pkey here, please check the final link and if it has all the required parameters.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
NickOg 08 Mar, 2015
Hi Max
I have run it and copied it again. This is the generated code from the toggle box - not code that i wrote. Code generated using your 'tutorial' as a model.

Here it is again and that gcb= is there

ccname=lisCourseReceiptsPickToggle&gcb={mdlListCourseReceipts.}&val=0

<a href="/index.php?option=com_chronoconnectivity5&cont=lists&act=toggle&ccname=lisCourseReceiptsPickToggle&gcb={mdlListCourseReceipts.}&val=0&fld=accountPaid&model=mdlListCourseReceipts&Itemid=448"><img src="http://www.devj3c105.pmhu3a.org.au/libraries/cegcore/assets/images/enabled.png" kasperskylab_antibanner="on"></a>


Puzzled.
:?
Nick
NickOg 08 Mar, 2015
1 Likes
Hi Max

A sudden brain wave. I was using a view rather than using the underlying table. I was doing that to derive local dates with mySQL rather than PHP. It struck me that the view would probably not then know of the primary key value. So I switched from the view to the table and Eureka! all sorted. An easy fix to one of those 50 50 choices that is always wrong!

:mrgreen: :mrgreen:

Nick
Max_admin 08 Mar, 2015
Great news!🙂
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
NickOg 08 Mar, 2015
Now all I have to do is to derive the local date field via PHP box. working on that.

Nick
This topic is locked and no more replies can be posted.