Created
September 26, 2013 21:53
-
-
Save 1stevengrant/6721123 to your computer and use it in GitHub Desktop.
Breaks Matrix out into individual fields in a safecracker form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".addrow").click(function(){ | |
var m = Matrix.instances[0]; // gets the first Matrix instance on the page | |
m.addRow(); | |
return false; | |
}) | |
$(".remrow").click(function(){ | |
var m = Matrix.instances[0]; // gets the first Matrix instance on the page | |
m.removeRow(m.totalRows - 1); // removes the last row | |
return false; | |
}) | |
<a href="#" class="addrow">Add Row</a> | |
<a href="#" class="remrow">Remove Row</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment