Why do my clones of Bootstrap Selectpicker create additional dropdowns? - clone

Have created a checklist table with multiple dropdowns using Bootstrap Selectpicker but when I clone the table for some reason a second dropdown appears in the first cell. Been playing around with this for days as I'm sure it's my JQuery or something to do with the initialisation of the select...I think.
$('select.selectpicker').selectpicker();
I ran into issues at the start with cloning classes so ended up cloning data-* attributes which seem to work better, still can't fix this issue though.
All help appreciated.
Snippet of the table
https://jsfiddle.net/tyt06sfd/33/

To cut a long story short, I created a new form without using bootstrap selectpicker. Was much easier to create and maintain using HTML, CSS and JQuery.

Related

Can I conditionally render Livewire components on my page (as one can in Vue)?

I'm attempting to design a project in Laravel. I ran the following command to initialize the project: "laravel new demo --jet". When prompted to choose between inertia and livewire I chose livewire as I've heard better things about it.
A little back story, I'm about 2-3 weeks into learning Laravel and I've never used livewire before, although I am very familiar with using Javascript and am very experienced with Vue.js. I've looked elsewhere for a solution to my problem but now I'm not quite sure if Laravel even supports exactly what I'm looking for.
TL/DR:
I'm wondering what the best practice would be for rendering child components on a page. I would like to create a dashboard that has several options to choose from on the left side of the page. When a user selects an option, I'd like for a corresponding component to appear in the center of the page. If a user were to select a different option, the original child component would disappear and a new corresponding child component would become visible.
Ideally, I'd like to avoid using the router for this, although that might just be because I'm not entirely comfortable with using it. I do understand it's pretty heavily integrated into the Laravel workflow. As I mentioned, I'm used to using Vue where you can easily integrate JS functionality into your html and use conditional statements to hide/show child components without changing routes.
If anything I've said above is causing any confusion, let me know. Thanks.
P.S. If anyone has any good resources for learning livewire & laravel together please let me know about them! Laracasts has been great but I think Laravel recently updated their auth scaffolding and it's causing some confusion for me.

CKEditor: How to manually trigger ACF(Advanced Content Filter)

With older version of CKEditor, I use following code to manually trigger Advanced Content Filter before submitting the content to server, but this stopped working for Version 4.4. I wonder is there a way to manually trigger the ACF and/or other kinds of content validation in CKEditor?
editor.setData(editor.getData(););
Your solution actually worked for me! To be more precise, I used CKEDITOR.instances['instance_name'].setData( CKEDITOR.instances['instance_name'].getData() ) and it worked!
To other people asking: this can be very useful even if you have ACF turned ON; in our app there's a number of situations that we manipulate the DOM inside CKEditor directly using jQuery for some very custom features we have (we actually create some UI inside the editor area), but we don't want that forbidden HTML going to the server and this solution works perfectly.
(Of course we always sanitize on the server as well)
For us this
CKEDITOR.instances['instance_name'].setData( CKEDITOR.instances['instance_name'].getData() )
didn't work, but getting the data with 1 in the arguments worked.
CKEDITOR.instances['instance_name'].setData( CKEDITOR.instances['instance_name'].getData(1) )

Learning Yii: checking with ajax won't work

I have a small problem that seems to be big enough to hold me from my work.
As I said in the title, I am leaning Yii and after I developped my project, I realized that I don't have ajax check.
I tried to solve this by setting enableAjaxValidation to true and it didn't worked. I tried to make use of the method performAjaxValidation and, again, it didn't worked. The third way was to copy the content of performAjaxValidation and paste it inside my method (like in documentation and identical with the code generated by Yii.
I checked my js and they are loaded.
What could it be? How can I solve this? The problem is that I need my fields to modify while the user is completing the form.
Thank you!
PS: I checked some topics from stackoverflow but the only one who was related was Yii - Ajax Form with validations
Make sure the from that is being validated has the same ID that is being used in the performAjaxValidation function. For example if your form has the id product-form, the if statement should look like this:if(isset($_POST['ajax']) && $_POST['ajax']==='product-form')
If possible I recommend using Firefox with firebug extension so that you can debug whether the AJAX call is even being made, and what is being returned.

Can jqGrid downgrade if javascript is didabled?

I am currently evaluating grid components for our new portal project. I came across the jqGrid which I find quite interesting. One requirement I have is that the portal should work with javascript switched off.
I found this article on StackOverflow but it does not answer the question. Does anyone can tell me how jqGrid is dealing with this?
In the question which you referenced I could fine the following
Can we create the table using C# and then lay the JS over the top for
extra functionality?
Is it what you plan? Do you want that your portal works without JavaScript and produce pure HTML tables which hold the data without any Ajax requests, but in case of the user do has JavaScript on you want to use JavaScript, jQuery and jqGrid?
In the corresponding answer it was suggested to use tableToGrid function to convert the existing HTML table inclusive the contain to the jqGrid. It seems me the way which you can also follow. Why you are not satisfied with the answer?
To tell the trust I have no customers more where JavaScript is switched off. Do you want to develop the portal for some mobile devices or some other special endpoints which has no JavaScript? In my opinion JavaScript have to be on to be able to use Internet for the better productivity. So the portal which work without JavaScript will have the interface which is not up to date now. Either you have very special customer environment or the requirement seems me too hard.

How to create my own form in joomla

I want to create my own form that are submitted and values of that form will be stored in joomla database. How can i used the Joomla connection code to interacte with the joomla database.
If you just want to get your work done, there are some components already avaiable in Joomla Extension's website to your form's needs. CkForms is a good one, you can create simple forms with it that are automatically saved in the database (supports upload of files too).
If you want to learn how to write extensions in Joomla, you should read Joomla Official Documentation website.
Extensions in Joomla are divided in "Components", "Modules" and "Plugins". More informations about these differences can be found here and here.
What you're trying to achieve sounds a "component" to me. Downloading the CkForms and reading it's source code should get you started to Joomla's way of writing components.
EDIT: Joomla has a huge API with a lot of features. It has a database module of it's own, with insert methods and such. Reading Joomla's API website before implementing your component it's a good idea to avoid "reinventing the wheel" and it's a good practice since those methods are extensively tested by all Joomla users.
The JForm class helps you build forms.
Documentation can be found here:
joomla CMS: http://docs.joomla.org/API16:JForm
joomla API: http://api.joomla.org/11.4/Joomla-Platform/Form/JForm.html
This class provides you with ready to use form elements and form loading and/or processing methods
This class includes validation methods, date picker control, color picker, etc.
Of course, as another mentioned above, if you are building a module, component, or application, you will need to learn how to to develop a module, component or application. Of these three, the module is the easiest to implement.
The application gives you much freedom b/c you are not constrained to the CMS paradigm, front and back end complexities. However, there is little documentation about how to develop applications with Joomla framework b/c joomla as a framework is relatively new
This tutorial gets you started understanding how to use JForm to create a form in Joomla: http://www.ostraining.com/blog/how-tos/development/getting-started-with-jform/
Or you could just create add a html module to any position and then write the form in html i.e.
<form method="post" action="mycreatedpage.php"> <input type="text"/> <input type="submit">
Now just create a page that handles the code by emailing or inserting into db. I havent tried it but i think it should work.
Looks like everyone already told you almost everything I know except for the component creator. Very easy to use, and it follows Joomla standards. Will get you up and running within minutes.
I have got good working experience with Joomla RSForm Pro. It has got options for
validation
user email/admin emails on submit
file uploads
and many more
Good tutorials too. Get started with http://www.rsjoomla.com/support/documentation/view-knowledgebase/21-rsform-pro.html
Good luck!
Create View.
Create Model.
Create Table.
Create Controller ( if Needed ).
Create Form xml file.
Go here for more information:
http://docs.joomla.org/Standard_form_field_types
Take a look at the Chronoforms extension - does more than you want.
You have two options:
Use an already built custom form extension
Create your own custom form extension (or outsource it)
Now if you only want to modify the user registration form, then you can do some PHP customization to accomplish your goal.
Making forms in Joomla can be done in a couple of ways.
If you just wanted a contact us, you can just create a page with a menu item for the User contact form. This gives you a page with a Members address and contact form. So all you would need to do was add the user as the company of the websites home address and email. But the form is very basic, name, title, textarea for message.
Next up from that you could just make a Custom HTML module add add a form to it in plain HTML like +Sean said above this, you would need to code in PHP your own form process script. You would not get error in form data checking unless you also wrote it.
Next you might rather look on the Joomla Extension Directory JED for one of the good extensions for 3 and 2.5 Joomla RSForms!Pro is good, and can do all we have needed. This lets you add fields one by one and move your form around. Then can auto generate or custom the html of the form.
You can easily create your own forms with Fabrik
Chronoforms are now a days a very popular solution for custom forms in joomla. Chornoforms support twitter bootstrap also. In simple 5 steps you can create a contact form with unlimited fields and also embed various function like DB save, Email, Thanks Message, Redirection on any page. There is events and events will have particular events.
Also possibility of extension of Normal joomla registeration. It will not extend the core registration but at the time of registration you can take various information from users.
I would use Chrono Forms, they work really well and are easy to use.
Download here
Here is a full tutorial on the new Chronoforms 5 to help you get started quickly and understand most of the features available.
CLICK HERE
You can use plugin to insert external php form in content. It is easy and you don't need to make plugin etc. Please use this.
I suggest you to use breezingforms: http://crosstec.de/en/extensions/joomla-forms-download.html
It's one of the best solutions for custom form creation in joomla.

Resources