Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FEATURE Trigger event when new or edit link is clicked

  • Loading branch information...
commit 7a755da1012a4fafa8bfb7c9b77c6b1cd0aa242f 1 parent 9efcb9b
@ajoneil ajoneil authored
View
16 javascript/GridField.js
@@ -69,6 +69,20 @@ jQuery(function($){
).css({'position':'relative','margin':'0 auto','width':'65%'}).appendTo(eleInput.closest('th'));
}
}
- });
+ });
+
+ $('fieldset.ss-gridfield .new-link').entwine({
+ onclick: function(e) {
+ $(this).trigger('opennewview', $(this).prop('href'));
+ return false;
+ }
+ });
+
+ $('fieldset.ss-gridfield .edit-link').entwine({
+ onclick: function(e) {
+ $(this).trigger('openeditview', $(this).prop('href'));
+ return false;
+ }
+ });
});
View
2  templates/Includes/GridFieldAction_Edit.ss
@@ -1 +1 @@
-<a class="action-edit" href="$Link">edit</a>
+<a class="edit-link" href="$Link">edit</a>
View
2  templates/Includes/GridFieldTitle.ss
@@ -1,3 +1,3 @@
<tr class="title">
- <th colspan="$ColumnCount"><h2>$Title</h2> <a href="$NewLink" class="action ss-ui-action-constructive ss-ui-button ui-button ui-widget ui-state-default ui-corner-all new">Add new</a></th>
+ <th colspan="$ColumnCount"><h2>$Title</h2> <a href="$NewLink" class="action ss-ui-action-constructive ss-ui-button ui-button ui-widget ui-state-default ui-corner-all new new-link">Add new</a></th>
</tr>
Please sign in to comment.
Something went wrong with that request. Please try again.