Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(function() {
- $('#repeat_content').hide();
- var data = [
- <% for user in @users %>
- { name: "<%= user.full_name %>", id: "<%= user.id %>", type: "<%= user.type %>" },
- <% end %>
- <% for team in @teams %>
- { name: "<%= team.name %>", id: "<%= team.id %>", type: "Team" },
- <% end %>
- ];
- $("#users").autocomplete(data, {
- mustMatch: true,
- matchContains: true,
- formatItem: function(row, i, max) {
- return row.name + " [" + row.type + "]"; // <-- ERROR OCCURS HERE
- }
- },
- formatMatch: function(row, i, max) {
- return row.name + " " + row.id;
- },
- formatResult: function(row) {
- return row.name;
- }
- });
- });
- </script>
Add Comment
Please, Sign In to add comment