Forums

Autocompleter inside multiplier

Yudhizth 19 Sep, 2015
Dear all,

I have a form that contain multiplier, and autocompleter inside the multiplier. I get confused, when I try autocompleter without multiplier, it works good. But when I applied to multiplier, it's do nothing. The different only on fields selector, usually we put this value with for example #country, On multiplier I put #text[__N__][nm_kab]. And custom code on kabupaten event
<?php

$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query = "SELECT `nm_kab` FROM `tbl_m_kabupaten` ;";
$db->setQuery($query);
$countries = $db->loadcolumn();

foreach($countries as $country){
 if(!empty($form->data['tag']) AND stripos($country, $form->data['tag']) === false){
  continue;
 }
 $json[] = array('id' => $country, 'text' => $country);
}
echo json_encode($json);




So, How to create autocompleter works on multiplier?
Thank you.
GreyHead 20 Sep, 2015
Hi Yudhizth,

I think that you will have to hand-code the Ajax call to make sure that it is linked to the correct row of the multiplier and that the returned results are added back to that row. I doubt that Max anticipated that the Multi-Row code would need to handle an Autocompleter.

I have got dynamic drop-downs to work with the Multi-Row - my guess is that similar code would work with an AutoCompleter. Basically I added a function that ran when the Add (or Delete) button was clicked - but with a short delay to allow the Add/Delete code to run. Then it checked the rows in the AutoCompleter to see what had changed and, if a row had been added attached new events to that to work the drop-down.

Bob
Yudhizth 15 Aug, 2016
Thankyou Bob,

Could you explain me more detail about dynamic dropdown inside multi-row?. I hands up with autocompleter 😢
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger