slickgrid

How to perform partial matches when filtering Slickgrid using column-level headers?

旧巷老猫 提交于 2019-11-29 23:06:49
问题 When using a fixed header row to implement column-level filters, how can I return cells with a partial match? ie: search term: "omato" returns: automator, tomato etc. 回答1: Under MyFilter in the example replace this loop... for (var columnId in columnFilters) { if (columnId !== undefined && columnFilters[columnId] !== "") { var c = grid.getColumns()[grid.getColumnIndex(columnId)]; if (item[c.field] != columnFilters[columnId]) { return false; } } } with this.. for (var columnId in columnFilters

slickgrid validate column with regex

筅森魡賤 提交于 2019-11-29 22:46:07
问题 There is a simple sample with column validation: function requiredFieldValidator(value) { if (value == null || value == undefined || !value.length) { return {valid: false, msg: "This is a required field"}; } else { return {valid: true, msg: null}; } } and to validate column it is just needed to put this option: validator: requiredFieldValidator But how can I use regex function if I need to pass extra parameter - regex string. 回答1: By default, you cannot pass more parameters into the validator

SlickGrid AJAX data

走远了吗. 提交于 2019-11-29 22:30:29
I'm trying to get AJAX working with SlickGrid. The example given is hardcoded for Digg . Also, I don't think the cache is working in that example. And because of the Digg rate limiting, it's hard to really get feel for how it works. How can I setup SlickGrid to get data from my database with paging. I just went through this, so here's how I did it: Copy content of example6-ajax-loading.html (in the SlickGrid download) into your html file - let's call it mygrid.html (Or into your code that generates html. In my case I'm using CodeIgniter, so I copied into mygrid_view.php). Copy slick

Saving Changes in SlickGrid with php

两盒软妹~` 提交于 2019-11-29 15:35:27
问题 I have a SlickGrid set up, it is reading data from my database with PHP, my problem is arising when i try to save the data back to my database, I am trying to use JSON to give me an array that I can then use to write back to the database, i have see this thread explaining this: Saving changes in SlickGrid So I have the hidden form element in my code, and am using JSON to encode the data variable, the assign it to the data hidden input on the form, this form posts to a page called save_price

How to use jQuery SlickGrid with PHP / MySQL (load server data and save changes)

扶醉桌前 提交于 2019-11-29 15:00:51
问题 Please, in all the examples found in the SlickGrid code, the data array was randomly generated on the client side. Getting: I need to know how to use PHP to fetch this information from a MySQL Database and return it using jQuery / AJAX to the SlickGrid. Saving: I already found a link on StackOverflow for saving data from the grid using a hidden input (Saving changes in SlickGrid) but it's not really clear how I ought to handle this data on getting to the PHP script. Some detailed help and/or

SlickGrid: how to view full text for long cell entries?

耗尽温柔 提交于 2019-11-29 07:32:21
I'm using a SlickGrid data table and some of my cells have very long text entries (1000 characters or more). By default, SlickGrid only shows some of the text, and abbreviates the rest using an ellipsis. This works well, except that I'd like to show the full text on mouseover, or have some other way to expand the cell to show the full entry. Is this possible with SlickGrid, and if so how? Anand Just use this plugin: https://github.com/mleibman/SlickGrid/blob/master/plugins/slick.autotooltips.js Register it like this and you are done! mygrid.registerPlugin(new Slick.AutoTooltips()); By default,

SlickGrid AJAX data

て烟熏妆下的殇ゞ 提交于 2019-11-28 19:10:35
问题 I'm trying to get AJAX working with SlickGrid. The example given is hardcoded for Digg. Also, I don't think the cache is working in that example. And because of the Digg rate limiting, it's hard to really get feel for how it works. How can I setup SlickGrid to get data from my database with paging. 回答1: I just went through this, so here's how I did it: Copy content of example6-ajax-loading.html (in the SlickGrid download) into your html file - let's call it mygrid.html (Or into your code that

SlickGrid select editor

半城伤御伤魂 提交于 2019-11-28 10:06:50
I want to make a dynamically populated html select for a select cell. I extract some information from a database which is different for every row item. The problem is that the editor loses the initial data and I don't know how to keep some data for a specific cell. Has someone done this before? function StandardSelectCellEditor($container, columnDef, value, dataContext) { var $input; var $select; var defaultValue = value; var scope = this; this.init = function() { $input = $("<INPUT type=hidden />"); $input.val(value); } $input.appendTo($container); $select = $("<SELECT tabIndex='0' class=

How do I autosize the column in SlickGrid?

谁说我不能喝 提交于 2019-11-28 04:39:25
I want slickgrid to autosize the columns based on the widest content or header text - whichever is wider. In simpler terms, I want it to simulate the default behavior of regular HTML tables when it comes to column sizing. How can I do it in slickgrid? When constructing your options, you can use forceFitColumns: true var options = { enableCellNavigation: true, forceFitColumns: true }; This will make the columns fill the entire width of your grid div. The OP is looking for columns to grow to match their content. grid.autosizeColumns() grows the cells to fit the parent container, which is not the

SlickGrid: how to view full text for long cell entries?

与世无争的帅哥 提交于 2019-11-28 01:29:02
问题 I'm using a SlickGrid data table and some of my cells have very long text entries (1000 characters or more). By default, SlickGrid only shows some of the text, and abbreviates the rest using an ellipsis. This works well, except that I'd like to show the full text on mouseover, or have some other way to expand the cell to show the full entry. Is this possible with SlickGrid, and if so how? 回答1: Just use this plugin: https://github.com/mleibman/SlickGrid/blob/master/plugins/slick.autotooltips