This content has been marked as final. Show 1 reply. Re: How to disable cell editing in JTable 807555 Feb 18, 2002 6:40 PM (in response to 807555) Create a new Tablemodel by extending DefaultTablemodel. Override the isCellEditable method to return true or false depending on the cells you want to edit or not. These approaches work well for most types of in-place editors. However, if the JTable control in the tested application uses specific in-place editors (for example, check boxes, combo boxes and others), you may need to work with them in a custom way. Simulating User Input. To modify grid cell values, you can input new values directly to grid cells.
Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upHave 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
Comments
![Disable Cell Edit In Jtable Disable Cell Edit In Jtable](http://ecomputernotes.com/images/JavaExampleTableImageInJApplet.jpg)
commented Jan 23, 2013
Hi, Today i had to turn off these buttons for one specific jtable instance and it took me some time to 'dig in'. I think that giving the option to enable/disable them would be good feature. Also in other table i needed to stop add/edit buttons from doing default actions and replace it with simple href (for adding/editing data, wich couldn't be displayed properly in jqueryUI dialog) |
commented Jan 24, 2013
![Disable Cell Edit In Jtable Disable Cell Edit In Jtable](/uploads/1/2/5/5/125586668/695934084.png)
I agree, I need to disable editing on one table too. How did you do it? I did it by hiding whole column, like this |
commented Jan 24, 2013
Hi all, If you want to hide edit column, that means you don't allow user to edit records, just do not define a updateAction (http://jtable.org/ApiReference#act-updateAction). jTable does not shows that column. If you want to create a link instead of standart edit button, just dont define an updateAction and create a custom field by display (http://jtable.org/ApiReference#fopt-display) option. For instance: I hope that helps you. |
commented Jan 24, 2013
Got it, thanks a lot! |
commented Feb 24, 2016
What about editing the jtable api button markup. Like I need rather than the default edit and delete icon I need my own custom button having glyph-icon and button text. Example: <button> Edit </button> Is that possible? |
commented Feb 24, 2016
You could use jquery to modify the html content of the button when the form loads. |
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment