Coder Social home page Coder Social logo

gilek / bootstrap-gtreetable Goto Github PK

View Code? Open in Web Editor NEW
163.0 163.0 73.0 151 KB

Extension of Tweeter Bootstrap 3 framework which allows to use tree structure inside HTML table.

Home Page: http://gtreetable2.gilek.net

License: MIT License

JavaScript 96.93% CSS 3.07%
bootstrap

bootstrap-gtreetable's People

Contributors

dunmaksim avatar emadgh avatar emnsen avatar gilek avatar platinumthinker avatar songlipeng2003 avatar wbraganca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bootstrap-gtreetable's Issues

Adding new item on same level as existing items.

Steps to reproduce:

1.Under "root", create new node n1.
2.Under "root", create new node n2.
3.Under n1, create new node n11.
4.Under n2, create new node n21.
5. Make sure that n1 and n2 are collapsed showing n11, respectively n21.
6.Under "root", create new node n3.

Problems

  1. n21 is shown as a child of n3.
  2. Can no longer collapse n1, n2, n3.

For more information, see picture below.
image

PHP sample source code

Hello,

your treetable is very nice, but the sample you provided which is downloadable is not enough due to the absence of the PHP file or on how to load it from JSON.

can you help by provided the files?

thank you so much

Rename action title for each level

How to rename action title on each node. eg on level 0 I need add Segment & Category,
on level 1 I need add Category & SubCategory and on level 2 I need add subcategory.

Hiding buttons

Hi,

how to completely hide Actions button on node level?
setting defaultActions: null, actions: null doesn't do much :(

extension

Hello
Tell me how can I show tree immediately disclosed? (Solution: return the full array)
And if I can display a list other than root?

Changing dataSource to URL and method propertyes.

Hello!

Now dataSource method must function return:

dataSource: function(id){
    return "tree/items/url/" + id + "/";
}

I think, good idea is removing this function and adding URL and method propertyes to function interface:

$().gtreetable({
    url: "tree/items/url/",
    method: "GET"
});

Internal plugin send data via this URL:

$.ajax({
    method: this.method,
    url: this.url,
    data: {
        parentId: undefined, //For root, tree item id for real hive
        level: 0             //For django-mptt, for example
    }
}).success(function(items){
    if ($.isArray(items)){
        //Work to inserting items into DOM
    }
});

Cache not working?

How is the cache supposed to work? I would like to preserve the state of the menu on page load - is that what the cache does?

Is there a different way to cache the state of the menu across page loads?

Thanks!

Documentation is extremely lacking

There's not nearly enough details in the configuration section to understand how this is used. How is data pulled back from the AJAX query into the table? How do you specify elements from your JSON model? What is "template" configuration and how is it used?

If you don't want to include documentation, at least provide a couple examples of these things in play so we can see how it works.

Search in tree (ajax)

Hi all!

Is there a way to make search in tree in this plugin? Searching in tree like jstree plugin has with ajax. Thanks!

Callback for root nodes shouldn't return a list

Root nodes in the tree are expected to be returned as a list. The Flask framework's implementation of json (jsonify) treats top-level lists as a security risk:

The problem are arrays at top-level in JSON. [...] An attacker can use this (like above) to get all the data you exported in your JSON file.

There is more information about a workaround in this issue:

I appreciate that top-level array elements are not allowed to be created in Flask's jsonify() implementation (http://flask.pocoo.org/docs/0.10/security/#json-security). Also, there are for sure straight-forward strategies for solving this in application code, for example by wrapping the list in a dictionary: jsonify({"items": collection}).

Incorrect node drop position

Dragged node takes incorrect position when it dropped as child to node that already has last expanded child.
It inserts after last child, but it's own children draw after new node and can moved with it.
Problem can easy solved if you will insert dropped node as first child.

Thanks.

Adding additional fields

Guys,

it is not really an issue,

I would like to know whether is there a way to add additional fields instead of only one field when an user wants to add a new child?

Thanks in advance

Json file

Hello,
I am trying to use this extension.
My problem is, I don't know how to write my structure in the Json file.

I write something like that ( I see this exemple of the second issue ) :
{"nodes": [ {"id":4070,"name":"123.","level":0,"type":"default"}, {"id":4005,"name":"1254.","level":0,"type":"default"} ] }

I have datas who are displays.
image

But When I click on the arrow I have this display :
image

It displays under the arrow the datas who are already display.

Furthermore I don't know how to write the childrens of a category.

Thank you for the future help.

Checking for the existence of the language file

I registery language file. Use the widget:

        return $this->render(
            '@gilek/gtreetable/views/widget',
            [
                'title' => Yii::t('tree', 'Tree'),
                'options' => [
                    'draggable' => true,
                    'manyroots' => true,
                    'language' => Language::getCurrentCode(),
                ],
            ]
        );

Crashes error 404 because:

        gilek\gtreetable\Widget
        ...
        if (array_key_exists('language', $this->options) && $this->options['language'] !== null) {
            $assetBundle->language = $this->options['language'];
        }

it is better to use file_exists.

Include less file

hey,
could you include the less file that the css is generated from to the project?
this might help integration into bootstrap if we could use the style with our bootstrap variables.
thx

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.