简体   繁体   English

如何使用js创建可编辑的网格

[英]How to create an editable grid using js

I am looking to create a grid structure using javascript or one of its libraries. 我正在寻找使用javascript或其库之一创建网格结构。 My idea is as follows: I am a merchandise manager for a retailer and want to create an application to tie into the django project I have been working on to track item sales based on display location. 我的想法如下:我是一家零售商的商品经理,并且想要创建一个应用程序以绑定到我一直在致力于根据显示位置跟踪商品销售的django项目。 The javascript piece would involve drawing a grid on the screen and allowing the user to draw 'areas' over the grid. javascript部分包括在屏幕上绘制网格,并允许用户在网格上绘制“区域”。 Each area would contain a set number of gridboxes, each representing a pallet of goods. 每个区域将包含一定数量的网格框,每个网格框代表一个货物托盘。 At the time the grid is drawn, each box is a DOM object that can be assigned to event handlers etc. When an area is drawn over aa series of these boxes, they become active and each box can be assigned different characteristics. 在绘制网格时,每个框都是一个DOM对象,可以分配给事件处理程序等。当在一系列这些框上绘制区域时,它们将变为活动状态,并且可以为每个框分配不同的特征。 In the end, each box would effectively represent an empty pallet that could then be assigned an item. 最后,每个盒子将有效地代表一个空托盘,然后可以为其分配一个项目。 It's position could then be correlated with sales data via my django app. 然后可以通过我的django应用将其位置与销售数据相关联。 I just need a way to broadcast/manage the location data using javascript. 我只需要一种使用javascript广播/管理位置数据的方法。

Is there a jquery plugin or some other js library that would facilitate such a project? 是否有一个jquery插件或其他js库可以简化这样的项目? I have checked into Raphael and it will work, but will take more time to create. 我已经检查了Raphael,它可以工作,但是需要更多时间来创建。 I am wondering if there is already some kind of grid based drawing tool that would facilitate the process. 我想知道是否已经有某种基于网格的绘图工具可以简化该过程。

Everytime I think of a javascript Grid, I always thing about the fantastic TableSorter 每当我想到一个javascript Grid时,我总是对神奇的TableSorter感兴趣

And if you append an editable version to it, I would would say you will have the best AWESOME project! 如果您在其中添加了可编辑的版本 ,我会说您将拥有最好的AWESOME项目!

:o) :O)

extJS javascript框架具有可编辑的网格,有关示例演示和源代码,请参阅http://dev.sencha.com/deploy/dev/examples/grid/edit-grid.html

JQuery UI's Selectable would probably be a good place to start. jQuery UI的Selectable可能是一个不错的起点。 It makes it easy to create a grid whose areas are selectable by dragging a box over it. 通过在其上方拖动一个框,可以轻松创建区域可选的网格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM