I would like to place the delete button from Joomla category view in the item view, so that when a user navigates in backend to that item he would be able to delete it.
I tried to move the function of the delete button from category view to the item view but it doesn't work since that function requires a item to be selected. In item view that particular item should already be selected.
You probably want to use something like this:
if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'articles.delete','JTOOLBAR_EMPTY_TRASH');
}
And add a hidden checkbox field in the view with the id variable [i.e. page id] in the view
Related
I was wondering if it was possible to make a select dropdown inside a gravity form that can auto select a dropdown item according to the current page that it was loaded in.
For example:
I have 2 pages:
page A
page B
On every page I have the same form (form is made once).
And in that form I have a dropdown with 2 items (page A and page B)
But when I load page A I would like to make sure that the dropdown auto selects page A so that i can use conditional logic.
Ditto for page B.
How can i make sure that this will be possible in a short amount of time?
This is what i did so far:
app.js
e('.button[href^="#"]').on("click", e.proxy(this.openModal, this)),
this.prefillPopup();
prefillPopup: function () {
var i = parseInt(e("body").attr("class").split(" ")[2].replace("page-id-", ""));
e("#input_5_8").val(
{
427: "Personeelsfeest",
429: "Bedrijfsfeest",
431: "Walking en seated diners",
433: "Seminaries & Presentaties",
435: "Productlancering",
437: "Modeshows",
439: "Event op maat",
440: "Activiteiten",
}[i]
);
},
What i did is creating function that when the popup modal is opened/loaded the dropdown will be automatically filled with the data that I want it to be filled with.
The only thing is that it doesn't fill up with the content that I specify.
The dropdown needs to be filled with the desired titled related to the page ID that is being viewed in the browser at that time.
I want to add product record under a product category. But if expected category not found on the select option I don't want cancel from this step I just want to add a category from this step. If I add the category then it will load select option without page refreshing.
Here I have to select option field
when I click on add category
After saving category it will load on the select option field
First use a different php page to call only options in select.
Then,
<script>
$("#id_of_submit_button").click(function(){
var category = $('#id_of_input').val();
$.ajax({
type: 'POST',
url: 'page_to_insert_category.php',
data: {category:category},
success:function(data){
//call the function which you used to get the options again
}
});
</script>
You will get the value of category in php page as
$_POST['category']
1.on click of submit button call an ajax
2. on same controller after save write logic for updated records in desc order and return in response updated array.
3. in success of ajax write logic for select last id record. ex. ($('#your_id [value=3]').attr('selected', 'true');)
4. trigger update on that select dropdown variable. ex. $('#mySelect').val('ab').trigger("updated");
I am creating a table that displays a list of customers and their information. I have a few filters that, when selected, modify the table as needed and do so automatically. But when I click the Filter button underneath to save the filters selected and add them to the URL, the URL changes to the correct address but the table returns to the original table. Any ideas how to have the filters not reset when clicking the filter button?
I have a page with a list of all the items. Which is http://localhost/myproject/items
Now I have item details pages which fetch the data from the database based on the item clicked
The url of the item details page is http://localhost/myproject/items/item_detail/3
I want to change the route from http://localhost/myproject/items/item_detail/3
to http://localhost/myproject/items/{item title}
routes.php
$route['items/{item title}'] = "items/item_detail/$1";
How can i get the item title(from database) in place of {item title} in the above code
Please help
Basicly, I have a <select> with a few options, when selected, it loads a jQuery dataTables table with content, in that table are options to edit/delete that content.
When a user deletes this content, or edits, it's redirected back to the first page, having to select the category again.
How would I set it so, that the <select> is auto selected, and the dataTable also loaded after an redirect?
My project is in PHP, so I can track what category it 'came from'
To auto select the category from your categories:
$(document).ready(function () {
$("#categories").val('<?php echo $selected_category;?>');
});
Assuming you have the $selected_category value (what category it came from).