Bug Tracker

Modify

Ticket #2768 (closed enhancement: fixed)

Opened 6 years ago

Last modified 4 years ago

data should accept a hash

Reported by: scott.gonzalez Owned by: flesler
Priority: major Milestone: 1.4
Component: data Version: 1.2.3
Keywords: Cc: scott.gonzalez
Blocking: Blocked by:

Description

data should support

$(el).data({
    key1: val1,
    key2: val2
});

as an equivalent of:

$(el).data('key1', 'val1').data('key2', 'val2');

Attachments

2768-data_from_hash.diff Download (394 bytes) - added by Morgan 6 years ago.
add data from hash

Change History

Changed 6 years ago by Morgan

add data from hash

comment:1 Changed 6 years ago by Morgan

The patch check if key is an object, if so it sets data for each key/val pair.

comment:2 Changed 6 years ago by flesler

  • Type changed from bug to enhancement

comment:3 Changed 5 years ago by flesler

  • Status changed from new to assigned
  • Cc scott.gonzalez added
  • Component changed from core to data
  • Owner set to flesler
  • Milestone changed from 1.2.4 to 1.3.3
  • need changed from Review to Patch

comment:4 Changed 4 years ago by dmethvin

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

As of 1.4, .data() accepts a hash.

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

View

Add a comment

Modify Ticket

Action
as closed
Author


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

 
Note: See TracTickets for help on using tickets.