Skip to content

Instantly share code, notes, and snippets.

@jrsalunga
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrsalunga/5300beb571888c0da125 to your computer and use it in GitHub Desktop.
Save jrsalunga/5300beb571888c0da125 to your computer and use it in GitHub Desktop.
if(k.match(/id$/) && k.length > 2){ // eg: "userid" no "id"
var s = k.split('id')[0];
this.$el.find(".table-model #"+s+".search").val(this.model.get(k));
}
if(key.substr(key.length - 2) === 'id'){
$(".table-model").find('#'+key+' option[value='+data[key]+']').attr('selected', 'selected');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment