Bug Tracker

Modify

Ticket #2316 (closed enhancement: wontfix)

Opened 5 years ago

Last modified 2 years ago

removeData for complete namespaces

Reported by: klaus Owned by:
Priority: low Milestone: 1.5
Component: data Version: 1.5
Keywords: data Cc:
Blocking: Blocked by:

Description

The removeData methods should work on complete namespaces - similiar to unbind - so instead of

$(el).removeData('foo.ns').removeData('bar.ns');

you can write:

$(el).removeData('.ns'); 

Change History

comment:1 Changed 3 years ago by dmethvin

  • Component changed from core to data

comment:2 Changed 3 years ago by boushley

This seems like a reasonable enhancement, and would make the api more consistent to allow for namespacing data within .data()

comment:3 Changed 3 years ago by snover

  • Keywords needsreview added
  • Priority changed from minor to low
  • Version changed from 1.2.3 to 1.4.4rc
  • Milestone 1.2.4 deleted

The .data method doesn’t do namespacing like that. Namespacing for .data would look more like:

$('#foo').data('bar', {});
$('#foo').data('bar').baz = 2;
$('#foo').removeData('bar');

I am pretty sure this will be wontfix but gonna discuss it with some folks.

comment:4 Changed 3 years ago by rwaldron

  • Milestone set to 1.4.5

comment:5 Changed 3 years ago by dmethvin

  • Keywords needsreview removed
  • Status changed from new to closed
  • Resolution set to wontfix

The period is not currently a special character in .data() names. Implementing this could cause regressions for anyone who used names that contained a period.

It's simple for a user to implement their own namespace by assigning a Javascript object to a simply-named .data() item.

comment:6 Changed 2 years ago by john

  • Version changed from 1.4.4rc to 1.5

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

comment:7 Changed 2 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.

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.