Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
5621 Lượt xem

after 2 days of searching I've successful know now how to access to the form view dom , but when i apply my style this.$el.addclass('div')

,the style is affecting all records and not only the record that meet condition , how to set the style for one record ?

Ảnh đại diện
Huỷ bỏ

this.$el.find('a more precise selector').addclass('div')

Câu trả lời hay nhất

Add a class on form view or inside form view make a div. then add a css file in assets backend by adding your css rules.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

If you added this line "this.$el.addclass('div')" into some function, like "init" in the widget javascript code, then $el would point to all elements added by this widget. If the widget adds some tree view rows, It would add your class to all tree view lines elements.
You should try to write more specific jquery selector, like this one:

$('tr[data-id=' + some_id )

 It searches for tr with attribute "data-id = some_id"


Ảnh đại diện
Huỷ bỏ