Question about custom editor HTML #846
-
Hi, congrats on the v5 release! I'm interested in implementing a tree grid editor (using merged cells to represent branches) that has the ability to manifest custom editing interfaces for different kinds of cell contents. Practically, what I envision doing is using a system like HTMX to fetch an HTML form generated server-side and impose it over a cell when that cell is clicked. Has anything like this been done? I see in the docs that there are various plugins but I'm looking for something more freeform, like a React component but without the overhead of using React. HTMX seems like a recent technology that could support this kind of approach. Let me know if this question is too vague and I can give some more specifics of my target use case. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Having a look at HTMX, there's nothing really new there that couldn't be achieved with a very minimal amount of javascript. HTMX just hides the js. It's also not dissimilar to the old ASP .NET Webforms model, where controls could have server side events. Anyhoo, the tree example is probably the closest to what you are looking for. The examples wiki page is the best place to look for inspiration. |
Beta Was this translation helpful? Give feedback.
-
Thanks, the tree example isn't quite what I'm looking for but with merged cells I should be able to find my way there. I was looking at the examples page but didn't quite see something that matched what I envision. On this page there is a table whose cells are displayed using custom HTML elements. In this case, it appears that passing a column with a Would it work to have the HTML within the cell change when the cell goes into editing mode? I.e. strings of text inside the cell could be replaced with text fields that can be used to edit those strings, stuff like that. |
Beta Was this translation helpful? Give feedback.
-
Absolutely. There is an aynchronous post-processing feature which allows slow render operations in formatters to work without bogging down scrolling operations. Editors can do anything they like in their code. But I'd recommend using JSON as a payload and constructing the HTML in javascript. |
Beta Was this translation helpful? Give feedback.
-
Thanks, is there a strong SlickGrid-specific reason not to send an HTML payload? I'm using a toolset designed around server-side rendering of HTML, it makes for a much simpler frontend than using a client-side renderer. |
Beta Was this translation helpful? Give feedback.
-
No compelling reason not to. It's just not done much any more these days, it was in fashion in the late 90s and 2000's. But if you are using a server-side toolkit, as long as it has good sanitation of user-entered data, then it's fine. |
Beta Was this translation helpful? Give feedback.
Absolutely. There is an aynchronous post-processing feature which allows slow render operations in formatters to work without bogging down scrolling operations. Editors can do anything they like in their code. But I'd recommend using JSON as a payload and constructing the HTML in javascript.