Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new dom attributes in a row #627

Open
emmanuel78 opened this issue Jun 2, 2013 · 5 comments
Open

new dom attributes in a row #627

emmanuel78 opened this issue Jun 2, 2013 · 5 comments

Comments

@emmanuel78
Copy link

Hello,
i would like to have the possibility to add a new attribute to the dom of a div corresponding to a row not a single cell. For example i would like to add an html5 attribute draggable="true". It wouldn't change the way slickgrid works but it would make it more flexible. What do you think about this ?

@icoxfog417
Copy link
Contributor

You can add style to row by using dataView.getItemMetadata . please see this StackOverflow issue.
http://stackoverflow.com/questions/8930167/how-do-i-add-a-css-class-to-particular-rows-in-slickgrid

If you want not only style but also some dom attribute , I think you can use jquery by adding attribute to row.
//set class=attribute-target by dataView.getItemMetadata. and ...
$(".attribute-target").attr("draggable","true");

@augustnmonteiro
Copy link

Hello,

I do a pull request that solve this case. :)

#1078

@emmanuel78
Copy link
Author

Fine,
could you change from :
for(attribute in metadata.attr)
to :
for(var attribute in metadata.attr)
?

@6pac
Copy link

6pac commented Jul 31, 2015

loop should read:

        for (var attributeName in metadata.attr){
            if (!metadata.attr.hasOwnProperty(attributeName)) continue;
            attr += attributeName + "='" + metadata.attr[attributeName] + "' ";
        }

good work though.

@augustnmonteiro
Copy link

Thanks, I changed the loop to use the solution proposed by @emmanuel78 and @6pac

jesenko pushed a commit to plandela/SlickGrid that referenced this issue Dec 29, 2023
…eibman#627)

* added the possibility to store `userData` while saving grid state

* minor code readability enhancement

* resolved an issue with the `save` function being executed from `notify`ed events - in this case, userData is actually the triggering `jQuery.Event`

* improved userData storage in slick-grid state

* improved userData storage in slick-grid state

Co-authored-by: arash dalir <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants