Client manager now renders views in bootstrap.
parent
3859429ed6
commit
784fd14917
|
@ -17,7 +17,7 @@
|
||||||
<a class="btn btn-small btn-primary" href="#">New Client</a>
|
<a class="btn btn-small btn-primary" href="#">New Client</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table id="client-table">
|
<table id="client-table" class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
<th>Grant Types</th>
|
<th>Grant Types</th>
|
||||||
<th>Scope</th>
|
<th>Scope</th>
|
||||||
<th>Authority</th>
|
<th>Authority</th>
|
||||||
<th class="span8">Description</th>
|
<th>Description</th>
|
||||||
<th>Refresh Tokens</th>
|
<th>Refresh Tokens</th>
|
||||||
<th class="span1"></th>
|
<th class="span1"></th>
|
||||||
<th class="span1"></th>
|
<th class="span1"></th>
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
$(function () {
|
//$(function () {
|
||||||
|
|
||||||
|
|
||||||
|
var ClientModel = Backbone.Model.extend({
|
||||||
var Client = Backbone.Model.extend({
|
|
||||||
|
|
||||||
// We can pass it default values.
|
// We can pass it default values.
|
||||||
defaults:{
|
defaults:{
|
||||||
|
@ -20,7 +19,7 @@ $(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
var ClientCollection = Backbone.Collection.extend({
|
var ClientCollection = Backbone.Collection.extend({
|
||||||
model:Client,
|
model:ClientModel,
|
||||||
url:"../api/clients"
|
url:"../api/clients"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -39,30 +38,27 @@ $(function () {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//this.model.bind("change", this.render, this);
|
this.model.bind("change", this.render, this);
|
||||||
debugger;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render:function (eventName) {
|
render:function (eventName) {
|
||||||
$(this.el).html(this.template(this.model.toJSON()));
|
|
||||||
|
$(this.el).append(this.template(this.model.toJSON()));
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
events:{
|
events:{
|
||||||
"change input":"change",
|
"click .btn-edit":"editClient",
|
||||||
"click .save":"saveClient",
|
"click .btn-delete":"deleteClient"
|
||||||
"click .delete":"deleteClient"
|
|
||||||
},
|
},
|
||||||
|
|
||||||
change:function (event) {
|
editClient:function () {
|
||||||
},
|
alert('edit');
|
||||||
|
|
||||||
saveClient:function () {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteClient:function () {
|
deleteClient:function () {
|
||||||
|
alert('delete');
|
||||||
},
|
},
|
||||||
|
|
||||||
close:function () {
|
close:function () {
|
||||||
|
@ -71,8 +67,13 @@ $(function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var view = new ClientView;
|
var view = new ClientView({
|
||||||
|
el:$('#client-table tbody'),
|
||||||
|
model: new ClientModel()
|
||||||
|
});
|
||||||
|
|
||||||
});
|
view.model.set({name:'hello world'});
|
||||||
|
|
||||||
|
//});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@
|
||||||
<a class="btn btn-small btn-primary" href="#">New Client</a>
|
<a class="btn btn-small btn-primary" href="#">New Client</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table id="client-table">
|
<table id="client-table" class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
|
@ -101,7 +101,7 @@
|
||||||
<th>Grant Types</th>
|
<th>Grant Types</th>
|
||||||
<th>Scope</th>
|
<th>Scope</th>
|
||||||
<th>Authority</th>
|
<th>Authority</th>
|
||||||
<th class="span8">Description</th>
|
<th>Description</th>
|
||||||
<th>Refresh Tokens</th>
|
<th>Refresh Tokens</th>
|
||||||
<th class="span1"></th>
|
<th class="span1"></th>
|
||||||
<th class="span1"></th>
|
<th class="span1"></th>
|
||||||
|
|
Loading…
Reference in New Issue