Jquery Mobile - Update List Row containing images, text ! - javascript

I am new to Jquery!
I am trying to load a list dynamically, without the page being refreshed. I will be getting data(parsed) from an array which i have to load in the list dynamically.
Its basically a contact list with Chat icon, Username, Presence or status, and Custom message which are part of the list.
Kindly share any code snippet or example which would help me in accomplishing this task quickly
Tx !

Well, make the ajax call, update the html, then call refresh() on the list per the docs. That would be the first thing I would try.
Updating lists
If you add items to a listview, you'll
need to call the refresh() method on
it to update the styles and create any
nested lists that are added. For
example, $('ul').listview('refresh');
We're currently working on a few
improvements to the refresh method, so
keep your eye on Github for updates.
http://jquerymobile.com/demos/1.0a4.1/docs/lists/docs-lists.html

Related

Reload external javascript library in AlpineJS modal

I'm trying to make something work, that seems easy but can't figure it out yet.. Here's the thing:
I have a livewire component. This component can trigger a modal window to show user details. One of the field is a select that will have a list of product associated. Because I have a lot of products, I want to use a dynamic select by using the library choices.js That way, I can filter the product from an ajax call instead of loading the whole datas directly into my select element.
Problem: I can't make the choices.js library work. It seems that the plugin won't be initialized since it lives inside the modal box, that will be trigger after the first page load.
How can I achieve to make the choices.js library initialize? Is there a workaround known?
Thanks in advance for any feedback that could help!
Cheers!

Auto save data with Node.js

Right now I'm building a team based project with Node.js/MySQL/React and have been stuck at a ToDo list part. I would like to know what is the recommended or fastest way how to save data or options to database automatically and without any submit button on each row.
Todo item
You could do a single POST when adding a new row, and whenever you change the options you could do a PUT request, but as a general design rule I'd advise against it : you want to be able to review all your changes before committing them to the database, plus this requires a lot more requests, hence more controllers rather than just having one.
Looking at your screenshot why don't you have a single submit button at the bottom of the table ?

About AngularJS pagination (I used localStorageService before but it wasn't the solution i wanted to apply)

First, Thank you for watching this question!
I'm newbie to angularJS and i'm trying to make pagination to be more flexible to use.
Below is my situation.
I made pagination function
It works as my intention
But, When i get into other page(leave list page which includes pagination function), and try to go back, the problem appears!
(Here is what i want to solve) I go back to list page by clicking backspace key or clicking back button on view. and the params i entered in list page is gone!
In multi page application, the url can be '/tt?aid=11&bid=22&cid=33', and i get into detail view page, and i can retrieve to '/tt?aid=11&bid=22&cid=33' by just clicking back button. but in angularjs, it goes back to list page with no params.
And below is what i tried to solve above problem.
I used local-storage-service
I used onPageUnload event(of browser)
I'm not sure if this best fits.
Store the page no.
When you click back to get that list, feed that page no.
page no can be stored in a scope variable.
Your pagination function should be able to give the list based on page no.

Magento - Simple Configurable Products Extension

I'm using the Magento SCP extension to change various details on the product page when selecting an option in the configurable product.
I need to extend the functionality so that I can change the description, image etc when clicking on a thumbnail image instead of changing the list options.
As far as I can tell, the function that deals with the changing of product description etc is:
Product.Config.prototype.reloadPrice
I'm not sure how I can run this when I click on a thumbnail, what information do I need to pass to the function to run properly?
Take a look at this site I am working on, this is using bundle products. But I am just looking to get an idea of what you are trying to do..
Click on the individual products to see them load below your selection
Let me know if this is what you are looking to do and I can help guide you
Site Example
The site I am demonstrating is using a custom route I load via Ajax.
I figured it out in the end.
When changing the dropdown values from clicking on an image elsewhere in the page I need to run the following code:
spConfig.configureElement(element)
Where (element) is the Dropdown's ID which I stored in a VAR further up the page.

Dynamic Loading Grids; Javascript or Tag library

I am looking for a grid implementation on my dashboard. The requirement here is that if the data that the grid might be fetching changes while a user is looking through the grid, the changes should be reflected. So the row present in page 1 may be present in page 2 after sometime. If the user clicks on page 2, he should be shown a fresh page that is fetched from database and that item should be in page 2. So, I need to use a pagedObjectList to get the data and show that data when user looks for the next page. The same requirement is for sorting too.
So I am looking for a javascript Grid like jqGrid or DHTMLX grid or a Tag Library which has some sort of ajax calling mechanism for sorting and paging instead of showing the old data which is fetched first.
Please suggest any grid/ tag library implementation which can fulfill the above mentioned requirement. Thanks in advance
I finally went with DHTMLXGrid, it has all the configurable actions I needed, like onPageAction, onSort etc. I could simple write my custom code for those trigger events. I would also recommend it to others, pretty handy and solid.

Categories

Resources