Using dropbox (select) in CC direct list editing

GreyHead 06 Nov, 2015
Hi ArnKor,

As far as I can see you would use the same format as in the FAQ but in the Fields box add the HTML for the drop-down select element in place of the <input /> tag there.

Bob
ArnKor 06 Nov, 2015
Hello Bob,

thanks for replying. I tried the following which renders a box but it is empty and i cannot click the arrows to open the list.

article_model.project_status:<select name="article_model[{cf_id}][project_status]">
<option value="1">one</OPTION>
<option selected value="2">{article_model.project_status}</OPTION>
<option value="3">three</OPTION>
<option value="4">four</OPTION>
</select>


Where am i wrong here?

Thanks & kindest regards,
AK
GreyHead 06 Nov, 2015
Hi AK,

I'm no expert in CC but I think that it all has to be on one line
article_model.project_status:<select name="article_model[{cf_id}][project_status]"><option value="1">one</option><option selected value="2">article_model.project_status}</option><option value="3">three</option><option value="4">four</option></select>

Bob
ArnKor 06 Nov, 2015
Hello Bob,

thank you for your support! It works! Just one thing:
Pressing "Update list" ends with an pop up without text. Debug is not showing anything and the new value does not get saved.

Where do i put the ID (article_model-cf_id) to save?

Thank you & kindest regards,
AK
ArnKor 06 Nov, 2015
Hi Bob,

i forgot to enable the check box! Now the save button ends with an success message but the value did not get saved.

What am i doing wrong?

Thank you & kindest regards,
AK
ArnKor 06 Nov, 2015
article_model.project_status:<select name="article_model[{cf_id}][project_status]"><option selected value="{article_model.project_status}">{article_model.project_status}</option><option value="novo">novo</option><option value="analise">analise</option><option value="esperando pagamento">esperando pagamento</option><option value="executando">executando</option></select>
GreyHead 06 Nov, 2015
Hi AK,

The first thing to try is clicking the Delete Cache icon in the CC toolbar, that should refresh CC's table info.

Bob
ArnKor 06 Nov, 2015
Hi Bob,

i do this every time i change my forms. But this did not help.

My thought is that there is something wrong with fields code above because using a text input worked fine ...

Here some info about my columns list:
_SELECTOR_
article_model.project_status:Status
article_model.titulo:Titulo
article_model.user_name:Nome
 


Any other ideas?
ArnKor 06 Nov, 2015
Answer
1 Likes
This is the code to get the editable list with dropbox/select:

article_model.project_status:<select name="article_model[{article_model.cf_id}][project_status]"><option selected value="{article_model.project_status}">{article_model.project_status}</option><option value="novo">novo</option><option value="analise">analise</option><option value="esperando pagamento">esperando pagamento</option><option value="executando">executando</option></select>


I hope that helps someone!

Thanks & kindest regards,
AK
kwok 06 Feb, 2016
Hi AK,

I tried your way and the dropdown looks great!

swapOffers.offer_status_text:<select name="swapOffers[{swapOffers.id}][offer_status_text]"><option selected value="{swapOffers.offer_status_text}">{swapOffers.offer_status_text}</option><option value="Open">Open</option><option value="Declined">Declined</option><option value="Offeree Re-open">Offer Receiver Re-Open</option></select>

I followed the Direct Listing Editing guide to add the following on Header code:
_TOOLBAR_SAVELIST_
_PAGINATOR_NAV_

and _SELECTOR_ on the column list.

However, the update never happens after clicking the save_list button and there is no alert message when seeing front view through the Connections Manager.

Here is part of the form:
<form action="/index.php?option=com_chronoconnectivity5&cont=lists&ccname=swapOfferReceiverEdit" method="post" name="admin_form" id="admin_form">
<input type="button" value="Update List" id="toolbar-button-save_list" data-url="/index.php?option=com_chronoconnectivity5&cont=lists&act=save_list&ccname=swapOfferReceiverEdit" class="toolbar-button" />

I hope you or Bob or Max can show me how to make it work.

Thanks,
kwok
kwok 06 Feb, 2016
In the dropdown construction,

swapOffers.offer_status_text:<select name="swapOffers[{swapOffers.id}][offer_status_text]"><option selected value="{swapOffers.offer_status_text}">{swapOffers.offer_status_text}</option><option value="Open">Open</option><option value="Declined">Declined</option><option value="Offeree Re-open">Offer Receiver Re-Open</option></select>

Is there a way to make the available options to be conditional to the original offer_status_text?

For instance, if {swapOffers.offer_status_text} = "Declined", the available options will be Offeree Re-open and Accepted. But, if {swapOffers.offer_status_text} = "Accepted", the only option is "Declined".

Thanks,
kwok
This topic is locked and no more replies can be posted.