开发者

Updating a data object with a new value

开发者 https://www.devze.com 2023-01-25 21:56 出处:网络
I\'m trying to update a data object with a new value. I have 开发者_如何学运维 if($(\"#ArticlesHolder\").data(event.data.id) != null)

I'm trying to update a data object with a new value. I have

开发者_如何学运维
 if($("#ArticlesHolder").data(event.data.id) != null)
    {           
        $("#ArticlesHolder").data(event.data.id, {name:event.data.name, nr:newNr, price:event.data.price, articlenr:event.data.articlenr});
    }    

Now I want to update a existing data object on $("#ArticlesHolder") but I only want to update one value not all values. How do I, for example, only update the nr to nr +1?


I think it's possible to change a data value simply but somehting like:

$("#ArticlesHolder").data(event.data.id).nr = '52';
0

精彩评论

暂无评论...
验证码 换一张
取 消