Bug Tracker


Ticket #6345 (closed enhancement: invalid)

Opened 4 years ago

Last modified 3 years ago

Allow .data() to accept a function for its setter argument

Reported by: kswedberg Owned by: kswedberg
Priority: undecided Milestone: 1.5
Component: data Version: 1.5
Keywords: Cc:
Blocking: Blocked by:


This would be nice, as it aligns .data() with .css(), .attr(), and all the domManip methods that take a function setter.

I've committed a patch to my fork on Github, along with tests:


Change History

comment:1 Changed 3 years ago by dmethvin

#5896 is a duplicate of this ticket.

comment:2 Changed 3 years ago by SlexAxton

  • Owner set to kswedberg
  • Priority set to undecided
  • Status changed from new to pending
  • Milestone changed from 1.4.3 to 1.4.5

That patch seems to be gone, karl, any chance we can see it again?

comment:3 Changed 3 years ago by kswedberg

  • Status changed from pending to assigned

Hey Alex, Sorry about that. I think I annihilated the fork/branch that had that commit. I'll try to get something committed again.

comment:4 Changed 3 years ago by kswedberg

  • Status changed from assigned to closed
  • Resolution set to invalid

ajpiano pointed out that .data() should be able to store functions just as it stores any other type. so treating functions differently ( by calling them ) wouldn't be a good idea. Closing this ticket. :'(

comment:5 Changed 3 years ago by john

  • Version changed from 1.4.2 to 1.5

There wasn't a 1.4.5 release, was actually 1.5.

comment:6 Changed 3 years ago by john

  • Milestone changed from 1.4.5 to 1.5

There was no 1.4.5 release, was actually 1.5.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


Add a comment

Modify Ticket

as closed

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.