Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow user to update cell value in afterChange #3

Open
avp90 opened this issue Aug 27, 2021 · 2 comments · May be fixed by #6
Open

allow user to update cell value in afterChange #3

avp90 opened this issue Aug 27, 2021 · 2 comments · May be fixed by #6
Assignees

Comments

@avp90
Copy link

avp90 commented Aug 27, 2021

allow user to update cell value in updatedValue
e.g.

        // Bind user-specified events if they exist
        if (typeof columnDef.afterChange == 'function') {
            let updatedValue = columnDef.afterChange(newValue, td);
            if (updatedValue) td.text(updatedValue);
        }
avp90 added a commit to avp90/jquery-editable-table that referenced this issue Aug 27, 2021
@avp90 avp90 linked a pull request Aug 27, 2021 that will close this issue
@torrobinson torrobinson changed the title allow user to update cell value in updatedValue allow user to update cell value in afterChange Aug 27, 2021
@torrobinson
Copy link
Owner

If I understand correctly, the intent would be that afterChange() would function as before when it acts as a void and returns nothing, but should it return a value, it behaves as a formatter? Thinking of a use-case.... perhaps you'd want to take in a number like 123.4, and after change, display it formatted as a currency, such as $123.40 - so afterChange() would add the $, round to 2 decimal places, and return the new string? If so, I like the idea!

@avp90
Copy link
Author

avp90 commented Sep 1, 2021

Yes exactly i use the table like described by you in production system now. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants