GithubHelp home page GithubHelp logo

datazenit / sensei-grid Goto Github PK

View Code? Open in Web Editor NEW
820.0 28.0 56.0 3.07 MB

Simple and lightweight data grid in JS/HTML

Home Page: https://datazenit.com/static/sensei-grid/examples/index.html

License: MIT License

JavaScript 89.24% CSS 8.62% HTML 2.01% Shell 0.12%
datagrid javascript grid jqery underscore lodash data data-table

sensei-grid's Issues

Help with saving a row

When I save a cell into base I use editor:save event

grid.events.on("editor:save", function (data, $cell) {
console.info("Column:", '@'+grid.getCellColumn($cell)+'@');
jQuery.ajax({
type: "POST",
url: "upd.php",
dataType:"text",
data:'ID='+grid.getRowData(grid.getCellRow($cell))["ID"]+'&Val='+grid.activeEditor.getValue()+'&Pole='+grid.getCellColumn($cell)+'&Text='
});
});

What is the best solution to save a new row to DB? When I add a new row I type something cell by cell. So it use editor:save event instead others.

Can not type some letters

"z","y" - letters that I can not type in cell. (also on another language).
Temp fix: delete "90, 89" from "var codes = [8, 9, 13, 27, 37, 38, 39, 40, 90, 89, 68];" but it disables undo/redo actions.

Suggestion: Ability to lock thead and columns

If you have a big datasheet that you want to edit, you may want to keep an ID-column to your left that's always visible.

And for the same reason, if you're further down the sheet, you may want to see the column names aswell.

Example on pinned column schema:
{ "name": "id", "type": "int", "pinned": true }

How to get the html or json code with format

Hi, I'm consulting what method is used to get the html code of the whole grid with editor.

I tried with the method
$ ("#Grid"). Grid (). GetGridData ()
but it only returns the text without formatting and if I insert an image it does not appear.

As I should do to capture all the elements.

Thanks and regards.

Undo support

How about undo operation support with keyboard shortcuts? :)

File/Image features

This is a great project. was wondering if you thought about supporting other widgets such as files/images ?

Suggestion for Select options having a different key and display

I can think of these two:

Option 1

var authors = {"values": [
    {"value": "1", "display": "Bob"}, 
    {"value": "2", "display": "John"}
]};

Option 2

var authors = {
    "display": ["Bob", "John", "Alice", "Jane"],
    "values": ["1", "TWO", "3", "4"]
};

I would like your thoughts before messing around and creating a PR

HTML code in cell

Hi! I need to show HTML (link or ) instead a simple text. Is it possible?

Suggestion: Make sensei-grid a standalone library (rather than jQuery plugin)

Hey guys, I love this idea and how lightweight this is, but I wanted to ask whether it is necessary for sensei-grid to be a jQuery plugin?

Does this:

$('#example').grid(data, columns)

add much value over this?

var container = document.getElementById('example')
grid(container, data, columns)

It seems like overall the JavaScript community is moving towards more standalone modules like this rather than jQuery plugins and just wanted to get your thoughts.

Cell "read only"

Do you think you will add an option "read only" for certain cells ? It will be very interesting !

bower install error

bower jquery#~3.10.1 ENORESTARGET No tag found that was able to satisfy ~3.10.1

Add/remove/change columns

Thanks for this great library.

It seems like the biggest missing feature at the moment is an API for the user to change the columns: to edit the column header, to add columns, or to delete columns.

I was wondering if there were any plans for adding such APIs and/or UI. Obviously it can be implemented by simply reloading the entire table with modified data and column objects, but this would be an ugly user experience and it would be nice to have some widgets, etc. that were as slickly implemented as the rest of what you've done here.

Is this anything you're thinking of doing?

Add new

How about "Add new row" functionality?

Support non-string columns

Not all values in a td can be represented as a string. E.g. I built a multi tag selector like the one you saw on stackoverflow.com.

In plugin.saveEditor there's line

if (normalizeLineEndings(val) !== normalizeLineEndings($td.text()))

If the val is something like ['tag1', 'tag2'] there would be an error.

Data from last column missing

When row:save (by pressing tab) event fires from the last column the value is missing from the data variable. Note if enter is pressed then the value is there.

From the example note the count column

If tab is pressed
author: "Bob"
body: ""
count: ""
created_at: ""
id: NaN
is_admin: "true"
status: ""
title: ""

If enter is pressed
author: "Bob"
body: ""
count: "55"
created_at: ""
id: NaN
is_admin: "true"
status: ""
title: ""

I'm wondering if I could use the editor:save event since it has the value?

Is this project still active?

First of all thanks for this awesome project Ive been using it in internal CRUD project and so far so good.

But last release is from last year, last commit from many months ago.

Are devs still actively working on this?

If not what are better alternatives?

Feature Suggestion: Add the ability for a SelectEditor to have differing values for value vs text.

For Example, I want the value of the cell to be the ID(value) of the selected item, but I want it to display the text of that selected item in the cell.

Ideas:

  1. Add a second array of data. Something like SelectValuesArray: [1,2,3,4,5]
  2. Change the data format of the SelectEditor to be something like:
    [
    {value:5,text:'Words'},
    {value:10, text:'More Words'}
    ]

I am going to start exploring how this could work in my personal Fork.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.