blue-mouse
Member
Hi,
I have on my form1
field: ___kp_zamawiajacy --- "Zamawiaj?cy" that is databasejoin and
i use for this element Popup form; " CC-21 - 37 - dopisywanie Zamawiaj?cych i ich Nr zam?wie?" - I use "Front-end-Select"
all what i need when use this "Front-end-Select" is to select first=on the top of list with records----- record.
In my table CC-21 - 37 - dopisywanie Zamawiaj?cych i ich Nr zam?wie?" i have in Data ___> Order by ccjom_cc_kk_ip2_zamowienia.id.
Need when is set this ordering choose/select first record from the top of my list.
This table is left join:
left JOIN ccjom_cc_kk_ip2_zamowienie ON ccjom_cc_kk_ip_zamawiajacy.id = ccjom_cc_kk_ip2_zamowienie.zam_zamaw
I need to do this operation more quickly and not use :
- icone with Front-end-Select
+
- click the first record on the top of this list
to get result datas jump to my form1
I need click one button "Wpisz ostatni Nr.zam." and to have this result - datas from record on top of my list see as jumped to my form1.
I try long time to write code in JavaScript to this button but this seems to be to much complicated to do this by myself.
Hmmm... Sample of code for button ---Javascript is here:
Please any tips.
I have on my form1
field: ___kp_zamawiajacy --- "Zamawiaj?cy" that is databasejoin and
i use for this element Popup form; " CC-21 - 37 - dopisywanie Zamawiaj?cych i ich Nr zam?wie?" - I use "Front-end-Select"
all what i need when use this "Front-end-Select" is to select first=on the top of list with records----- record.
In my table CC-21 - 37 - dopisywanie Zamawiaj?cych i ich Nr zam?wie?" i have in Data ___> Order by ccjom_cc_kk_ip2_zamowienia.id.
Need when is set this ordering choose/select first record from the top of my list.
This table is left join:
left JOIN ccjom_cc_kk_ip2_zamowienie ON ccjom_cc_kk_ip_zamawiajacy.id = ccjom_cc_kk_ip2_zamowienie.zam_zamaw
I need to do this operation more quickly and not use :
- icone with Front-end-Select
+
- click the first record on the top of this list
to get result datas jump to my form1
I need click one button "Wpisz ostatni Nr.zam." and to have this result - datas from record on top of my list see as jumped to my form1.
I try long time to write code in JavaScript to this button but this seems to be to much complicated to do this by myself.
Hmmm... Sample of code for button ---Javascript is here:
JavaScript:
$db =& JFactory::getDBO();
$query = $db->getQuery(true);
$query2 = 'SELECT `ip2_zamowienie_symbol1 ` FROM `ccjom_cc_kk_ip2_zamowienie` ORDER BY `id` DESC
LIMIT 1 ';
$db->setQuery($query2);
$result2 = $db->loadResult();
$query3 = 'SELECT `zam_zamaw` FROM `ccjom_cc_kk_ip2_zamowienie` ORDER BY `id` DESC
LIMIT 1 ';
$db->setQuery($query3);
$result3 = $db->loadResult();
$query1 = 'SELECT `ip_zamawiajacy_naz1` FROM `ccjom_cc_kk_ip_zamawiajacy` WHERE `ip_zamawiajacy_naz1`= ' .$result3. '';
$db->setQuery($query1);
$result1 = $db->loadResult();
$result4 = 'Firma GHIJKL';
$result5 = 'zam. 1234/2016';
// $formModel->_data['ccjom_cc_kk_karta_rejestr___kp_zamawiajacy_raw']=$result4;
// $formModel->_data['ccjom_cc_kk_karta_rejestr___zamow_symbol_raw']=$result5;
$('ccjom_cc_kk_karta_rejestr___kp_zamawiajacy_raw').value = 'Firma GHIJKL';
// $('ccjom_cc_kk_karta_rejestr___zamow_symbol_raw').value = zamow1;
Please any tips.
Attachments
-
Zaznaczenie_149.png49.5 KB · Views: 548
-
Zaznaczenie_150.png24.1 KB · Views: 555
-
Zaznaczenie_151.png36.6 KB · Views: 564
-
Zaznaczenie_152.png37.8 KB · Views: 544
-
Zaznaczenie_153.png114.4 KB · Views: 550
-
Zaznaczenie_154.png89.1 KB · Views: 556
-
Zaznaczenie_155.png54.1 KB · Views: 566
-
Zaznaczenie_156.png69.1 KB · Views: 569
-
Zaznaczenie_157.png26.3 KB · Views: 556