FEATURE Trigger event when new or edit link is clicked

This commit is contained in:
Andrew O'Neil 2012-02-23 14:54:03 +13:00
parent 9efcb9b8fe
commit 7a755da101
3 changed files with 17 additions and 3 deletions

View File

@ -71,4 +71,18 @@ jQuery(function($){
} }
}); });
$('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 File

@ -1 +1 @@
<a class="action-edit" href="$Link">edit</a> <a class="edit-link" href="$Link">edit</a>

View File

@ -1,3 +1,3 @@
<tr class="title"> <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> </tr>