Link with class myFabWin

Status
Not open for further replies.

startpoint

Active Member
Hi,
I use display element with this code:
HTML:
<a class="myFabWin" href="index.php?option=com_fabrik&view=form&formid=1&tmpl=component" rel="{'content':'test','height':500,'title':'my-llin- rocks','loadMethod':'xhr'}">link</a>
Link working properly, but I want to use if statement, does not work here.
So I decided to use calc element with this code:
HTML:
return '<a class="myFabWin" href="index.php?option=com_fabrik&view=form&formid=1&tmpl=component" rel="{'content':'test','height':500,'title':'my-llin- rocks','loadMethod':'xhr'}">link</a>';
The link not working, until I removed rel attribute.
But then there is a problem: the title is Advanced Search.
With rel attribute does not start, so I can change the title, so in this variant there is a problem.

How should the code of the link so that it works in list view?

Regards
 
Try escaping those single quotes in the rel, like \'. You are using single quotes as the outer quoting on your string, so the first (unescaped) single quote it comes to will close that string, leading to syntax errors.

-- hugh
 
I don't know. I've never tried opening a window from a link like that. I always use Javascript.

-- hugh
 
With Back button the form closes, but site redirect browser history -1.
I want to close this form without redirect like (x) button.
close.jpg

P.S.
When Ajaxify list is enabled add, edit, view row work, but with this link in my calc element does not work that way.
 
I just remembered I did have an example of using a calc to open a form I did for someone else, which does this:

Code:
return '
<a title="Edit" href="/joomla30/index.php/bands/form/17/{rowid}?tmpl=component" data-list="list_17_com_fabrik_17" class="btn fabrik_edit fabrik__rowlink" data-loadmethod="xhr"><i class="icon-edit "></i> <span class="hidden">Edit</span></a>
';

http://screencast.com/t/qk06yIrCO8tC

-- hugh
 
I use this code:
HTML:
return '<a title="Edit" href="index.php?option=com_fabrik&view=form&formid=14&table1___elem1_id={table2___elem2_id}" data-list="list_12_com_fabrik_14" class="btn fabrik_edit fabrik__rowlink" data-loadmethod="xhr"><i class="icon-edit "></i> <span class="hidden">Edit</span></a>';
where my list number is 12, and form number is 14, but not open in modal window.
I think that data-list"...." is wrong, or something else is missing.
 
Hi, give me a example how to load a form with javascript code?
I use this code:
Code:
Fabrik.getWindow({id:'5', 'loadMethod': 'iframe', 'contentURL':'http://mysite.comv/form/2?tmpl=component', 'title': 'New Title'});
but my form loaded with scroll. How to set dimensions height and width to auto?
How to fire this window with button appended to cascadingdropdown element?
 
It should do it automatically although loading in an iframe is complicated as you run up against cross domain issues which makes it harder for the code to inspect the DOM reliably.
The only way is to force a certain width/height on the window properties,

Code:
Fabrik.getWindow({id:'5', 'loadMethod': 'iframe', 'contentURL':'http://mysite.comv/form/2?tmpl=component', 'title': 'New Title', 'width': 500, 'height': 500});

or to add a onContentLoaded method do the js code:

Code:
Fabrik.getWindow({id:'5', 'loadMethod': 'iframe', 'contentURL':'http://mysite.comv/form/2?tmpl=component', 'title': 'New Title', 'onContentLoaded ': functon () {
 // add your custom resize logic here.
}});

How to fire this window with button appended to cascadingdropdown element?
That's getting really into custom coding, not something we support under a standard subscription I'm afraid
 
Hi,
In index.php file I set this:
PHP:
FabrikHelperHTML::script(FabrikHelperHTML::framework());
FabrikHelperHTML::iniRequireJS();
FabrikHelperHTML::windows('a.myFabWin');
Myy link have this syntax in display element:
PHP:
<a href="index.php?option=com_fabrik&view=form&formid=XX&tmpl=component&table_name___elementname_raw={table_name2___elementname2_raw}" class="myFabWin btn btn-success" rel="{'content':'Add','title':'Add','height':500,'loadMethod':'xhr'}">Add</a>

When I click on link I have this error in console:
Code:
Error: Mismatched anonymous define() module: function (){return g}
http://requirejs.org/docs/errors.html#mismatch
  ...=c[b]});return c}function C(b,c,d,g){c=Error(c+"\nhttp://requirejs.org/docs/erro...

What is wrong?
If I use 'loadMethod':'iframe' missing error, but the form does not load properly, after save does not close, and it is loaded list. The first option of loading everything loads properly, close properly and reload the first open form, but due the error ajax calculations in calc element do not work.

Regards
 
Last edited:
I really have no clue, and as Rob said in his last reply, this is getting into Pro support custom coding territory.

-- hugh
 
Everything works normally. The problem comes from the nfrpiwik plugin for piwik analytics.
After disabling the plugin everything is fine and I put the tracking code directly into the template.

I'm very sorry for your wasted time to determine the problem. :(

Regards
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top