backgrid

Is it possible to do this pagination without backgrid?

喜你入骨 提交于 2019-12-23 13:28:06
问题 I'm trying to implement server side pagination like datetable and I found backbone.paginator library, I don't know if there is something else. Through their examples they used another library to help accomplishing this which is backgrid.js and its paginator plugin Is it possible to do this pagination without Backgrid? Could you please add any example on this? 回答1: I developed the following code to share with you A JS/php code that do server site pagination and you could change it according to

Backgrid integration

人盡茶涼 提交于 2019-12-23 12:20:11
问题 How I would use backgrid within a backbone.marionette application? 回答1: It's as simple as it looks. Just add the Backgrid view to any region: MyApp.addRegions({ someRegion: "#some-div" }); var columns .... var userList .... MyApp.someRegion.show( new Backgrid.Grid({ columns : columns, collection : userList }) ); 来源: https://stackoverflow.com/questions/14790906/backgrid-integration

How would I refresh a Backgrid table with new data?

眉间皱痕 提交于 2019-12-21 06:35:47
问题 I have a Backgrid view on my page with a collection of data. Above the Backgrid view is another view called "filters" that allows the user to change the date range for the data so they can see results between two dates. I'm not sure what the cleanest way is to refresh the contents of the Backgrid view. Here is my code as it stands: // Fetch data var fetchingOrders = CRM.request("orders:entities"); // Create layout var ordersLayout = new List.OrdersLayout(); $.when(fetchingOrders).done

How would I refresh a Backgrid table with new data?

早过忘川 提交于 2019-12-21 06:35:03
问题 I have a Backgrid view on my page with a collection of data. Above the Backgrid view is another view called "filters" that allows the user to change the date range for the data so they can see results between two dates. I'm not sure what the cleanest way is to refresh the contents of the Backgrid view. Here is my code as it stands: // Fetch data var fetchingOrders = CRM.request("orders:entities"); // Create layout var ordersLayout = new List.OrdersLayout(); $.when(fetchingOrders).done

Backgrid paginator not working after filtering collection

好久不见. 提交于 2019-12-12 10:20:29
问题 I am trying to implement backgrid pagination on my backbone collection. It works fine until I implement the filter. After I filter my collection, the paginator's page number changes but when I click the other page, nothing happens. Here's my model and collection with the filter function: var Project = Backbone.Model.extend({}); var ProjectCollection = Backbone.PageableCollection.extend({ model: Project, state: {pageSize: 2}, mode: "client", queryParams: { currentPage: "current_page", pageSize

How would I refresh a Backgrid table with new data?

末鹿安然 提交于 2019-12-03 21:57:23
I have a Backgrid view on my page with a collection of data. Above the Backgrid view is another view called "filters" that allows the user to change the date range for the data so they can see results between two dates. I'm not sure what the cleanest way is to refresh the contents of the Backgrid view. Here is my code as it stands: // Fetch data var fetchingOrders = CRM.request("orders:entities"); // Create layout var ordersLayout = new List.OrdersLayout(); $.when(fetchingOrders).done(function (orders) { var ClickableRow = Backgrid.Row.extend({ events: { "click" : "rowClicked" }, rowClicked:

How to add a custom delete option for backgrid rows

帅比萌擦擦* 提交于 2019-12-03 16:59:04
问题 i have developed editable grid using backgrid and it looks good also. following is my output : when i select the check box and click on delete icon, then the selected rows are deleted. now i also would like to have the delete option on each row so that the user can delete the row directly. How to put delete icon on each row.?? 回答1: You can make a custom cell. var DeleteCell = Backgrid.Cell.extend({ template: _.template(" PUT YOUR HTML BUTTON TEMPLATE HERE "), events: { "click": "deleteRow" },

How to implement delete per row for backgrid

我怕爱的太早我们不能终老 提交于 2019-12-03 10:14:47
问题 I've been trying to implement a "delete" button for backgrid rows. A solution seems to be described here: How to add a custom delete option for backgrid rows However, I don't seem to get it working. Here is what I tried: var DeleteCell = Backgrid.Cell.extend({ template: _.template('<button>Delete</button>'), events: { "click": "deleteRow" }, deleteRow: function (e) { console.log("Hello"); e.preventDefault(); this.model.collection.remove(this.model); }, render: function () { this.el.html(this

How to add a custom delete option for backgrid rows

左心房为你撑大大i 提交于 2019-12-03 06:07:22
i have developed editable grid using backgrid and it looks good also. following is my output : when i select the check box and click on delete icon, then the selected rows are deleted. now i also would like to have the delete option on each row so that the user can delete the row directly. How to put delete icon on each row.?? You can make a custom cell. var DeleteCell = Backgrid.Cell.extend({ template: _.template(" PUT YOUR HTML BUTTON TEMPLATE HERE "), events: { "click": "deleteRow" }, deleteRow: function (e) { e.preventDefault(); this.model.collection.remove(this.model); }, render: function

How to implement delete per row for backgrid

…衆ロ難τιáo~ 提交于 2019-12-03 00:44:58
I've been trying to implement a "delete" button for backgrid rows. A solution seems to be described here: How to add a custom delete option for backgrid rows However, I don't seem to get it working. Here is what I tried: var DeleteCell = Backgrid.Cell.extend({ template: _.template('<button>Delete</button>'), events: { "click": "deleteRow" }, deleteRow: function (e) { console.log("Hello"); e.preventDefault(); this.model.collection.remove(this.model); }, render: function () { this.el.html(this.template()); this.delegateEvents(); return this; } }); and then using it like var columns = [{ name: