How to create an interactive HTML table that is resizable on demand - javascript

I am trying to implement a plugin which enables user to drag the border of an HTML table to adjust the size of it (like below). I tried to use vanilla JavaScript but it is not perfect.
Or (as a brainstorm), maybe can I not treat it as a HTML table element but some kind of graphics on a panel and use libraries such as WebGL to make it interactive. And also implement text typing in that graphics to make it like a table. Not sure if this is feasible?

Related

JS: Drag and drop image in a search engine interface

I'm building a search engine interface. I've got some webpages raw content (including images) in Lemur indexes. I want to drag and drop images and implement image searching later. I know how to make an image draggable in HTML by setting draggable="True". But it's not a good choice for me to change raw contents in Lemur indexes. Is there any way that I can implement image drag and drop in my main.js?
BTW, I current implement text drag and drop by:
var selection=document.getElementById('lemurbox').contentWindow.getSelection();
But this seem can only get text since the selection will be NULL after dragging a image.
Have you looked at jQuery UI? They have these functionalities built into their scripts. You can test all of them out at http://jqueryui.com/

Creating thumbnails of div content

I have very complex chart representation using svg (using d3.js library). Is it possible using javascript to create thumbnails of those area and display it somewhere on the page?
I have found jquery nailthumb plugin. But it needs image and it does not work exactly as I want.
Please let me know if it is even possible with javascript.

JS library for card sorting application

Use case:
A web page where the user is presented with several cards containing text. The user can classify the cards by dragging them to one of four containers. The cards should then snap into place, and the container should display a counter with the number of cards it contains.
The app is based on Rails, but this obviuosly needs to be done in JavaScript. The content of the cards is read and written to the server through a JSON API.
I know basic JS, CSS and HTML 5, but I hope someone can point me in the right direction when it comes to implementing this. For instance:
Should I use HTML 5 canvas?
Is there a JS library that will make the implementation easier?
If you can use make it without canvas, by using simple jQuery code.
Take a look at jQuery UI (https://jqueryui.com), especially at Draggable and Droppable.

How to make draggable DIVs which align to 960.gs or other grid framework?

I am working in making an app around the 960.gs based system (although the grid framework isn't set in store yet).
What I would like to do is enable the user to drag and drop specific layout elements (DIVs), which would, theoretically, move the blocks of the design around. I know JQuery UI has a drag and drop system, which may be a component of this project, but what I want to do is make sure that the user can only drag, drop and stretch/expand divs according to the limitations of the defined css grid. And make sure that nothing will violate the boundaries of the grid, and generate the proper css classes to display correctly....
I have scoured the net and stack exchange for some examples along this line, but I haven't seen anything. Can someone point me in the right direction?
I'm looking into a similar problem, and I found a few options that are not based on 960.gs.
jQuery EasyUI (www.jeasyui.com/) has something like this; here is a direct link to their demo.
There's also iNettuts, which is something similar.
Since you said the grid framework choice isn't solid, I think these options might be useful.

How to create an editable grid using js

I am looking to create a grid structure using javascript or one of its libraries. 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. The javascript piece would involve drawing a grid on the screen and allowing the user to draw 'areas' over the grid. 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 a a series of these boxes, they become active and each box can be assigned different characteristics. 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. I just need a way to broadcast/manage the location data using javascript.
Is there a jquery plugin or some other js library that would facilitate such a project? I have checked into Raphael and it will work, but will take more time to create. 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
And if you append an editable version to it, I would would say you will have the best AWESOME project!
:o)
JQuery UI's Selectable would probably be a good place to start. It makes it easy to create a grid whose areas are selectable by dragging a box over it.
The extJS javascript framework has an editable grid, refer to http://dev.sencha.com/deploy/dev/examples/grid/edit-grid.html for a sample demo and source code

Categories