Django : Filter bills with client name in the same page without reloading - ajax

in my view I have the list of bills , and I need to add a field in order to filter the list by client as bellow :
so that if I choose client rgg it will get only show bill of that client.
To do so, I need some orientation if I should do it with Ajax call , because I dont want to reload the page each time I change my choice.
I really need to know the best way to do such thing.
Thank You so much for your help

You do not mention if you are using a javascript component for the table allready.
If not, you can search for one that meets your needs (there are a lot of them). For example, DataTables.
Or you can create your own filtering logic, like this w3schools page shows.

Related

Dynamic content display

when I select (say customer) using Dropdown I would want to show users all the properties on a side table or division. Essentially, displaying the selected customer's fields on the same page for the users to verify/read.
I am using laravel-backpack for development and finding it difficult to implement. Any help is greatly appreciated.
I'm afraid there's no existing way to achieve that, you'd have to code it.
But you don't have to start from scratch, you can use the code for the select2 field (or whatever field you prefer) and create a new field type, say select2_and_preview by tweaking the Javascript inside that one file.
There's recently been a Feature Request for a similar feature (see here), you might want to pitch in with your opinion if you want it created by the team, and included in the official build.

COLDFUSION CFGRID Datapass with a post

I have a bit of a unique challenge today. I have a client that wants to be able to search for multiple items based on inserts into a cfgrid. Suppose we have the following web form:
A Country selection dropdown
A State Selection dependent AJAX dropdown
A city Selection dependent AJAX dropdown
An ADD Button
----------------------------------------------------
A CFGRID that will populate a row with selections when the user clicks the add button
----------------------------------------------------
And finally, a CLEAR button, and a GO button on the bottom.
The resulting page will then query the database and get some statistics about the cities selected. So, suppose an individual picks USA > Arizona > Scottsdale and USA > Arizona > Flagstaff. The grid below the options will 'save' each selection and reset to their default options, waiting for a user to pick additional options or click on 'GO'.
The resulting page will then generate columns that list some statistics about the communities and highlight the 'best of' between each selected community.
Each time a user selects the ADD button (assuming three criteria are selected) I want the information to be added into a CFGRID that displays the options selected. Then, After the user selects at least one country/city/state option, have all of the data in the CFGRID get passed to another page that does a query from the data selected. In theory, the user could pick as many communities as they want, assuming they are willing to let the database sludge through enough data to get what they want and wait through a 'loading' screen to get it.
I'm having these challenges, in no particular order:
- I have an HTML grid that I must use per client spec (No Java or Flash, must be HTML)
- I have no idea how to get the selected options into the CFGRID. I assume there is some JavaScript I can write that uses some sort of AddRow function to add data into the grid with the add button but cannot seem to find how to it on the interwebs
- After we conquer the above challenge, how do I pass the data from the grid into the results page? I thought about passing one big string or a structure, but I'm not sure how to do that through the URL or posting, nor how to get the data out of the grid. I wonder if I am better off coding some sort of string that gets passed from the options page to the results page with a get method instead of dealing with the stuff in the CFGRID and have the CFGRID serve only as a 'dummy' display container.
- Finally, after the pass is complete, I would need to loop through through the structure and perform a CFQUERY or CFSTOREDPROC on each row of data, then get the statistics I need to display on the results page. I assume this would depend on how I am getting the data from the options selection page to the results page.
THANK YOU ALL!
CFGRID is great to start, but it can be b*tch to customize and extend... Have you tried editable CFGRID with bind? See how far off it is from what you want first. If it turns out to be very far, then you might want to go for a jqGrid and code up some jQuery.
To start, read Using HTML grids and make the cfgrid editable.
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-7a01.html#WSc3ff6d0ea77859461172e0811cbec22c24-72e0
Once you got that working, look at these provided JS functions that you can use with CFGRID
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WS0ef8c004658c1089-6262c847120f1a3b244-8000.html
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSd160b5fdf5100e8f-4439fdac128193edfd6-7f5f.html
If you still demand a bit more, you might need to dig into the underlying ExtJS component. At that point I would rather use jqGrid
I found out that the best way to handle this was by using a SerializeJSON call and a Deserialize JSON call back and forth. By using JavaScript notation we are able to pass a complex JavaScript object (array) between one page and another. This has the value add of not having to worry about sessions timing out and making URLs clickable from one solution to the next.

Search View For Admin In magento

I have created a Sample Module (Admin Side) in Magento.. I managed To created a form and Then Stored the form field values in Database. Now I am trying To create a search view for that. to show me all the values which i have stored in my table. however i am not able to get it. when i press the tab I directly get the form view. I want the search view first and a button there which ll direct me to this form. I want it the same way as it is for product, category or any other module. Do anyone Know How can I do it.
It's called a grid. The process is kind of long to explain here, but if you search online there are a few tutorials that explain how to do it (here's one that I found useful: http://www.webspeaks.in/2010/08/create-admin-backend-module-in-magento.html). Keep in mind that you can also model your own code after core code. If you want to make a grid like the Category grid, then go look in the code how its made.

Insert relational data in lookup table

I am managing to construct a form (with FuelCMS) that has a look-up table, and the look-up table has a field that must be inserted at the same time as the relation (Figure 1).
Using a model inside my module I have finished the form to insert the data, I have a control (Figure 2) to select the relation between the two tables, and here is where my question comes. I need to show a pop-up (like the one when you press the "ADD" or "EDIT" button that allow the user to insert the value of the "objetivo" field (Figure 1) at the time you assign "Hitos" to the "indicadores".
What is the best way to do this? Can I attach a JS file to the form from the module to be able to capture the button click and show the pop-up? There are another better way already to achieve that task?
I hope I made my point clear, if not, please tell me and I will try to explain myself better.
Thanks :)
Figure 1
Figure 2
Thanks to the kind of the FuelCMS team I was at the end able to solve the situation I explained before, to achive the aim you should follow the next steps:
Add a javascript file on the module config (fuel/modules/MODULE_NAME/config/MODULE_NAME_fuel_module.php)
Use the Javascript hooks 'selectionAdded' and 'selectionRemoved' to launch the popup (FuelCMS uses jqmodal as popup) the functions pass as a parameter an array "vals" that contains the ID of the selected items.
Add a AJAX request in the popup code to retrive the form
Process the form and keep the values for later saving on database or manipulatión.
It could be a bit tricky if you need a complex logic but is an effective way of do it :)
Once again TAHNKS to the FuelCMS support people, i hope this help someone.
Best regards.

Filter multiple categories with a form

I’m about to develop an events board in Codeigniter, where each event has multiple categories. I’ve figured that i should use a related table for events and categories, like described here: http://codeigniter.com/forums/viewthread/152795/
The real deal is that I would like to have a categories filter, much like the one in Authentic Jobs. Never mind the js goodness and animations, but I want to know the logic behind it.
The hardest thing for me is the
multiple checkboxes that filter the
query. How should I approach this?
Second, I guess the whole
“preferences” are saved to a
session, right? I wouldn’t use an
URL for multiple categories.
Well, that site is all ajax.
When a category is checked/unchecked a click event is triggered. An ajax call is made and the results are updated.
It's got nothing to do with Codeigniter per se.
Click category
Send ajax request with categories data
Query database using categories in a where clause
Update results

Resources