Skip to content

Conversation

@silverstrangetech
Copy link

@silverstrangetech silverstrangetech commented Dec 20, 2021

For my project, I am using ext-grid and I needed to edit a value other than the title so I modified ext-edit to support that. Currently only one thing can be edited per table, but by using the new 'property' and 'spanClass' options the user can specify what to edit. The default functionality for editing the title remains unchanged.

If you're interested in pulling this functionality in then I can update the ext-edit wiki page.

It's been a long time since I submitted a pull request so if I did anything wrong or just inconvenient with this, please let me know.

@mar10 mar10 added enhancement ext-grid (Unsupported experimental plugin) patch labels Dec 21, 2021
@mar10
Copy link
Owner

mar10 commented Dec 21, 2021

Hi,
Does it mean that one can edit the title and zero or more arbitrary column values?

@silverstrangetech
Copy link
Author

No, that would be better though and I'll try implementing. Right now my change allows you to select something other than title, but only supports editing one column value per node.

@mar10
Copy link
Owner

mar10 commented Dec 22, 2021

The current idea to edit other column values would be like this:
https://wwwendt.de/tech/fancytree/demo/sample-multi-ext.html

Can you explain a bit, what your concrete use case is?

@silverstrangetech
Copy link
Author

Hmm. For some reason it never occurred to me to just make the column value I needed to edit an input like your example. I didn't find/notice that one while looking for a solution. That meets my use case so I'll close this pull request. Thanks for your time @mar10.

@silverstrangetech
Copy link
Author

silverstrangetech commented Dec 22, 2021

I suppose the only advantage of what I did would be that it lets you hook into the ext-edit events when editing. I want to automatically save the changed value to my database and update a calculated value on a folder FancytreeNode. I'm not aware of any Fancytree events I could hook into for detecting the input changes.

I can hook into normal HTML input events, such as jQuery's change event, but in that case the event will only give me the input element. I need to update the FancytreeNode data and I'm not sure how to get the FancytreeNode object starting with an input element inside a node, since normally I would be hooking into a Fancytree event and get the node object from there. What would be the best way to get the node object in this case?

Edit: After doing more research, I found that $.ui.fancytree.getNode(element) works for this.

@nathanhennig nathanhennig deleted the ext-edit-select-property-to-edit branch December 22, 2021 17:04
@nathanhennig nathanhennig restored the ext-edit-select-property-to-edit branch December 22, 2021 17:04
@silverstrangetech silverstrangetech deleted the ext-edit-select-property-to-edit branch December 22, 2021 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement ext-grid (Unsupported experimental plugin) patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants