Place A Delete Action Link In A Table Row In JEasyUI DataGrid
Posted by blogmeister on
January 21, 2013
To add an action similar to the image (edit, delete, save, cancel) above, add this table header tag within the table row tag.
|
1 |
<th width="100">Action</th> |
Now, in order for delete links to appear, you need to add a custom made Javascript function that has parameters ‘value, row and index’ and returns a string that dynamically creates an HTML hyperlink for the delete functionality.
|
1 2 3 |
function formatAction(value, row, index){ return '<a href="//" onclick="deleteRow(' + index + ')>Delete</a>'; } |
Lastly, you create another custom made function so that when the delete hyperlink is clicked, that function is called.
|
1 2 3 |
function deleteRow(index) { alert('Row ' + index + ' was clicked'); } |
tags: action, datagrid, delete, jeasyui
2 Comments
Insert Bulleted Or Numbered List Using HTML In JTextPane
Posted by blogmeister on
November 30, 2010
JTextPane does not have bulleted list or numbered list support. While making it happen using either StyledEditorKit or RTFEditorKit is not possible unless you create your own, I figure the easiest way to implement this feature would be through the use of an HTMLEditorKit since HTML supports both unordered and ordered lists.
The code below inserts HTML code of an unordered list into the JTextPane. For ordered or numbered lists, you can change the variables of the code and replace the <UL> HTML tag to <OL>.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
Action ulAction = new HTMLEditorAction("Unordered list", bulletButton.getIcon()) { @Override public void actionPerformed(ActionEvent e) { ulActionB_actionPerformed(e); } }; JButton bulletButton = new JButton(); bulletButton.setAction(ulAction); bulletButton.setText("bulleted list"); public void ulActionB_actionPerformed(ActionEvent e) { String parentname = ((HTMLDocument) editor.getDocument()) .getParagraphElement(editor.getCaretPosition()) .getParentElement() .getName(); HTML.Tag parentTag = HTML.getTag(parentname); HTMLEditorKit.InsertHTMLTextAction ulAction = new HTMLEditorKit.InsertHTMLTextAction( "insertUL", "", parentTag, HTML.Tag.UL); ulAction.actionPerformed(e); } |
tags: action, bulleted list, html, Htmleditorkit, jtextpane, numbered list, ol, ul, unordered list
No Comments
Photoshop Action To Smooth Skin Easily
Posted by blogmeister on
May 21, 2010
You know, smoothening the skin of a subject in your photo is a daunting task. Really, even if I will become an expert, if there is a shorter way to do it, then I am all for it. Photoshop actions are a great way to do just that. The best smoothening skin Photoshop action that I like is by Jean’s at unleashedART.com.
Once you run the action script, all you need to do is use the history brush and brush the skin parts of the subject. It is quite effective especially in armpit areas and oily skin. It can easily remove pimples and blemishes. See the sample image that Jean provided for her action script.










