db join element edit

coullet

Member
Hi,

i'm trying to add an edit option to dbjoin element for edit lookup record.

i'm ok with backend option, and adding the button in layout file.

In php file, i build the url for the button (in function "renderFrontEndSelect")

I don't find the row id of the selected record, and to dynamically change the rowid when user change this record?

In layout file what it suppose to do the line:
JText::script('PLG_ELEMENT_DBJOIN_ADD');

Thanks!
 
That's a language string, adding it to the JText javascript language array - that's how JavaScript uses language files.

You'll have to do it more or less how the Add button works. Add a watchEdit() function in the JS, which watches for the Edit button being clicked. In that function you can do this.getValue() to the get the currently selected value.

You could also do something similar to the showDesc stuff, around line 942, in init(), watch for a change, then get the value, if it's empty, disable the Edit button, and vice versa.

Then of course there's the issue of updating the selected row after the form is submitted and the window closes, as the label element may have been changed. Or it may be a CONCAT label, and you have no idea if anything the CONCAT uses to build the label has been changed. So you'll have to fire off an AJAX updateFromServer, I think.

-- hugh
 
ok, i'll dive in javascript...
Something i don't understand:
-how js take element settings (if element have or not an edit option activated)?
-Url in layout is getting with php, but how to pass url to layout with js?
Sorry for basic question, i don't still understand all the structure between js/php/layout and how they interact ;)
 
-how js take element settings (if element have or not an edit option activated)?

Each element plugin has a
elementJavascript() and
elementJavascriptOpts() which deal with collecting element settings and preparing them for rendering into the js code.

-Url in layout is getting with php, but how to pass url to layout with js?

In the PHP code we insert the javascript template with:
PHP:
FabrikHelperHTML::jLayoutJs('fabrik-progress-bar', 'fabrik-progress-bar', (object) array('context' => '', 'animated' => true));

Then in your js code you can get the DOM / HTML with
Code:
var newBar = jQuery(Fabrik.jLayouts['fabrik-progress-bar-success'])[0];
 
ok...
For the moment, all of that is a bit obscure, and i don't really understand what i do and what i need to do...
I learn fabrik code+php+javascript at the same time and...pfff... i regret my Delphi!
So if you have some tips to help on that, but for the moment i don't really know what to ask...
If not, i'll waiting someone make the job for me:rolleyes:
 
Well, that's why we don't have this option yet. It is not as simple as you might think to do, even though we already have an Add feature. And we're at the point with Fabrik where we can only add new features if people fund us to do it. The subscription support model just doesn't give us the "headroom" to implement features that only a few people need.


Sent from my Nexus 7 using Tapatalk
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top