What steps do I need to take in order to modify information within a table using Symfony?

Working on my Symfony project, I frequently need to display various views in table format.

I wish I could easily update the data by clicking on table cells, entering new information, and saving it dynamically.

After exploring jqGrid, DataTable with jEditable, I found that none of these options provide a straightforward way to integrate with jQuery.

To address this challenge, I created a custom view where a form replaces a row when clicked, but this approach is quite specific, and now I'm looking for a more versatile solution since I need similar functionality for other elements as well.

Is there a recommended best practice for handling this in Symfony? Should I consider using Angular or React for this task? What would be the optimal approach?

My ideal solution would involve automatically identifying the field being edited, making changes, validating the entity, and returning the updated result.

Here is an excerpt from my custom code:

{% extends ':Template/Backend:backend.html.twig' %}

{% block title_wrapper %}
    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-md-12 col-sm-12">
            <h2 class="inline-block">Coûts d'achat</h2>
            <span id="header_buttons" class="pull-right">
                <a href="{{ path('user_supplier_select') }}" class="btn btn-sm btn-white">Ajouter un fournisseur</a>
            </span>
        </div>
    </div>
{% endblock %}

{% block main %}

    <p>Assignez des fournisseurs à vos ingrédients. Vous pourrez ensuite paramétrer le coût d'achat.</p>
    <p>L'unité utilisée pour la quantité minimale d'achat est l'unité que vous utilisez pour gérer votre stock. Essayez d'adopter la même que votre fournisseur.</p>
    
    (Code continues...)   

Answer №1

A few months back, I found myself faced with the same requirements as well. After some research and experimentation, I was able to seamlessly incorporate free jqGrid into my Symfony 2.7 project.

To achieve this, I turned to a Symfony bundle known as thrace datagrid bundle. While it may have its complexities, once you navigate through them, everything falls into place smoothly. Unlike other plugins that tend to struggle in performance as the data grows, modifying jqGrid via Twig can help bypass any limitations imposed by Symfony.

The key takeaway from utilizing the thrace datagrid bundle is the structured json array it provides. Leveraging this, I was able to completely tailor the frontend interface to support various operations such as data editing, new data insertion, change saving, and more. Even with grids containing over 30 columns, the functionality remains intact, addressing concerns regarding managing extensive views efficiently. Additionally, jqGrid comes equipped with robust data validation features that can be implemented directly on the frontend.

I highly recommend revisiting jqGrid (the bundle) when working within the Symfony framework. Should you require assistance in integrating jqGrid with Symfony, feel free to reach out as I am more than willing to offer my support.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Troubleshooting problem in Vercel with Next.js 13 application - encountering "Module not found" error

Encountering a deployment issue with my Next.js 13 application on Vercel. I recently implemented the Parallel Routes feature of Next in my codebase. While pushing the changes to create a new pull request on GitHub, the branch's deployment on Vercel is ...

What is the best way to store all rows in a dynamically changing table with AngularJS?

I am facing an issue while trying to dynamically add rows for a variable that is a String array in my database. The problem is that it only saves the last value entered in the row instead of saving all of them in an array. Here is my current view code: &l ...

Using Angular ui.bootstrap tabs along with ui.router: a step-by-step guide

My initial approach to using ui.bootstrap tabs with ui.router is as follows: <tabset> <tab heading="Tab1" select="$state.go('home.tab1')"> <div ui-view="forTab1"></div> </tab> <tab heading="Tab2" select ...

Troubleshooting a JQuery AJAX Autocomplete problem involving PHP and MySQL

I am facing an issue with my autocomplete feature. It is functioning properly on one of my pages, but not on this particular page. Even though the correct number of entries is being retrieved, they all appear to be "blank" or are displayed in black text th ...

Utilizing jQuery's POST Method to Fetch JSON Data on a Website

I've developed a Java REST API and now I want to retrieve JSON data on my website (which is built using HTML & CSS) by utilizing jQuery. The method to be used is POST, and here is the structure of my JSON: { "sessionID" : "25574", "interactiv ...

What could be causing the slow loading time of my Shopify App developed using Next.js (React)?

I recently followed a tutorial at However, I am facing severe performance issues with my app. It loads extremely slowly when changing tabs, whether it's running on ngrok, localhost, or deployed on app engine. I'm new to React, Next.js, and Shop ...

Every time I reload the page, the tab indicator on Material-UI returns to the first tab item

After integrating material-ui tabs with react router, I noticed that the tab indicator resets to the first tab upon page reload. I suspect this is due to the initial value of the tab being set to zero and resetting on page refresh. To visualize the issue, ...

What steps can be taken to troubleshoot issues with the jquery mask plugin?

I am using the jQuery Mask Plugin available at to apply masks to input fields on my website. Currently, I am trying to implement a mask that starts with +38 (0XX) XXX-XX-XX. However, I am facing an issue where instead of mandating a zero in some places, ...

Nested Dynamic Routing

I am facing an issue with my dashboard that involves multiple user access. The path "/" displays a default and generic dashboard, while other dashboards are customized for different users. I am using Reactjs along with version "react-router-dom": "^5.1.2" ...

SDK for generating templates with JavaScript/jQuery

I am in the process of developing an SDK in JavaScript/jQuery that can generate templates based on user input, such as profile templates and dialog templates. These templates require data from an AJAX call to be created. User input should include certain ...

Issue with the Edit feature causing conflicts with the local storage and generating error messages

There seems to be an issue with my edit function that is causing it to override the local storage when I attempt to save and interfering with my delete function as well. I have searched through similar posts for a solution but have not been able to pinpo ...

The jQuery click function triggers immediately upon the loading of the page

Despite my best efforts to resolve this issue independently and conduct extensive research on Google, I am still unable to identify the root of the problem. It seems that the click function continues to activate upon page load. Kindly elucidate the under ...

Node-sass installation through NPM causing errors

I'm encountering difficulties installing node-sass in a project that builds and runs perfectly on my computer, but is causing major issues on my Surface when trying to install the packages. Note: I've attempted reinstalling and rebuilding the pr ...

Issues with changing background colors using Jquery animate

I am attempting to create a fading background color effect when a button is clicked. Currently, I can change the background color using this code: $("#" + lblqty).css("background","#e9f1ff"); However, when I try to use the animate function as shown below ...

AngularJS: Issue with $watch not triggering when changed in child scope

Here is the scenario I am facing: Within my parent scope, I have created an object named rule, which has an attribute called "keyword". A watcher is set on this keyword as follows: $scope.$watch("rule.keyword", function(newKeyword){...}); However, when t ...

Encountering a TypeError with Arg 1 while trying to execute the save method in jsPDF

I am currently working on a react project with a simple implementation of jsPDF. I am trying to execute the sample 'hello world' code but encountering an error when using the save method: https://i.stack.imgur.com/o4FWh.png My code is straightf ...

Learn how to effortlessly update models by integrating AngularJS with Django and Django Rest Framework

Here is a JSON representation of a post based on its ID: http://127.0.0.1:8000/update/1?format=json {"title": "about me", "content": "I like program", "created": "2014-11-29T18:07:18.173Z", "rating": 1, "id": 1} I am attempting to update the rating ...

Showing hidden errors in specific browsers via JavaScript

I was struggling to make the code work on certain browsers. The code you see in the resource URL below has been a collection of work-around codes to get it functioning, especially for Android browsers and Windows 8. It might be a bit sketchy as a result. ...

AngularJS - updating my UI after making changes to the data

Hello, I am looking to update an image on my user interface. I have different data points with a star icon. When I click on the star, it toggles a value in my object between true and false. This functionality is working well, but I am unsure how to dynamic ...

The datepicker feature has been programmed to only allow past or present dates

I've integrated a date picker on a website like so: <input type="text" id="popupDatepicker" placeholder="Select Date" name="from_date" class="input" size="50" /> Here's the script being used: $(function() { $('#popupDatepicker&apos ...