handsontable

handsontable: hide some columns without changing data array/object

拈花ヽ惹草 提交于 2019-12-07 11:33:39
问题 I have a data to show in grid. I am using handsontable to show data. Each 3rd column is computed as difference of previous two (for example, 3rd column is rendered as the sum of 1st and 2nd column; this is done by custom renderer taking sum of i-1 and i-2 columns). This is my custom renderer for "difference" columns: var val1 = instance.getDataAtCell(row, col - 1), val2 = instance.getDataAtCell(row, col - 2), args = arguments; args[5] = val2 - val1; if (args[5] !== 0) { $(td).addClass('grid

Javascript Handsontable - Uncaught TypeError: Cannot read property 'insertBefore' of undefined

我的梦境 提交于 2019-12-07 07:32:26
I'm using the handsontable library for creating neat tables. I literally copied the tutorial but the console (web developer console) gives me the following error: Uncaught TypeError: Cannot read property 'insertBefore' of undefined handsontable.full.js:4471 I link both the .css and the .js file correctly in the <head> tags. My javascript looks like this: var data = [ ["", "Ford", "Volvo", "Toyota", "Honda"], ["2016", 10, 11, 12, 13], ["2017", 20, 11, 14, 13], ["2018", 30, 15, 12, 13] ]; var container = document.getElementById('temp'); var hot = new Handsontable(container, { data: data,

Refresh a handsontable

拥有回忆 提交于 2019-12-07 01:25:46
问题 I want to refresh a handsontable grid. I have some columns with a dropdown filled with data of my database. But in my page, I have a first grid which insert data in this database and I get them in my second grid. But as my second grid is not refresh, I can't get the last value I just insert in the first grid. So how can I refresh the content of a handsontable please ? EDIT : I made a jsfiddle which illustrate my problem : http://jsfiddle.net/9onuhpn7/10/ On my jsFiddle, it works and I can get

Loading Handsontable from an AJAX-enabled WCF Service

蓝咒 提交于 2019-12-06 15:40:13
问题 I'm trying to display data in a Handsontable from an AJAX-enabled WCF Service but it does not show anything. CarsService.svc: [DataContract] public class Car { [DataMember] public string Name { get; set; } [DataMember] public string Year { get; set; } } [ServiceContract(Namespace = "")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class CarsService { [OperationContract] [WebGet(ResponseFormat = WebMessageFormat.Json)] public

handsontable: hide some columns without changing data array/object

孤者浪人 提交于 2019-12-05 18:08:44
I have a data to show in grid. I am using handsontable to show data. Each 3rd column is computed as difference of previous two (for example, 3rd column is rendered as the sum of 1st and 2nd column; this is done by custom renderer taking sum of i-1 and i-2 columns). This is my custom renderer for "difference" columns: var val1 = instance.getDataAtCell(row, col - 1), val2 = instance.getDataAtCell(row, col - 2), args = arguments; args[5] = val2 - val1; if (args[5] !== 0) { $(td).addClass('grid-column-class-nonzero'); } Handsontable.renderers.NumericRenderer.apply(this, args); I need to have a

Add a table type to a JSON editor

拥有回忆 提交于 2019-12-05 02:18:50
I want to understand the code of this JSON editor and modify it. In directives.js , there is a piece of code that tries to construct templates: var switchTemplate = '<span ng-switch on="getType(val)" >' ... ... + '<span ng-switch-when="Boolean" type="boolean">' + '<input type="checkbox" ng-model="val" ng-model-onblur ng-change="child[key] = val">' + '</span>' ... ... + '</span>'; // display either "plus button" or "key-value inputs" var addItemTemplate = '<div ng-switch on="showAddKey" class="block" >' + '<span ng-switch-when="true">'; if (scope.type == "object"){ // input key addItemTemplate

Retrieving a hidden header inside a sorted handsontable instance

五迷三道 提交于 2019-12-05 01:35:56
When using Handsontable , it seems hard to retrieve the header of a row from a contextual menu. Consider the following data source: var data = function () { return [["1212", "roman", "i", "ii", "iii"], ["3121", "numeric", 1, 2 ,3], ["4126", "alpha", 'a', 'b', 'c']]; }; It is possible to create a Handsontable instance that displays all of the data but the first two "columns", and that has a contextual menu as following: // Settings to display all columns but the first two var dataCols = [] for(var i=2; i<data()[0].length; i++) { dataCols.push({ data: i }) } // Instance creation var hot = new

Loading Handsontable from an AJAX-enabled WCF Service

独自空忆成欢 提交于 2019-12-04 22:55:26
I'm trying to display data in a Handsontable from an AJAX-enabled WCF Service but it does not show anything. CarsService.svc: [DataContract] public class Car { [DataMember] public string Name { get; set; } [DataMember] public string Year { get; set; } } [ServiceContract(Namespace = "")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class CarsService { [OperationContract] [WebGet(ResponseFormat = WebMessageFormat.Json)] public IEnumerable<Car> GetCars() { var cars = new List<Car>(); var car1 = new Car() { Name = "Kia", Year = "2008" };

Connect HandsonTable to MySQL server

主宰稳场 提交于 2019-12-04 14:30:24
问题 I am trying to use the Handsontable javascript library as a 'real time' CRUD interface to MySQL server. I have created a basic script to load up an instance of Handsontable in a browser and display some test data. See below <head> <script src="http://handsontable.com/dist/handsontable.full.js"></script> <link rel="stylesheet" media="screen" href="http://handsontable.com/dist/handsontable.full.css"> <div id="example"></div> <script> var data = [ ["", "Ford", "Volvo", "Toyota", "Honda"], ["2014

Retrieve data from handsontable to Struts2 Action via JSON not working

妖精的绣舞 提交于 2019-12-04 08:39:00
问题 I am using struts2-json plugin to generate JSON data and Ajax to populate table (handsontable) with data from that JSON (according to the source). Now, I need to retrieve data from table to Struts2 Action using Ajax by JSON. First I've implemented populating table with data passed by JSON from Struts2 Action to Handsontable, that was quite easy and it works. But why save do not work as you can see in attached code below? As I see in a firebug the POST is sent and in debug the request is