Jump to content

UnimDBListGrid button onclick


Ken_Sowyer

Recommended Posts

Получилось так.

  config.itemTpl = new Ext.XTemplate('<table class="tblObj">'+ 
                     '<tr>'+
                        '<td style="color:#2c81aa">ID {0}, ID на сайті: {13}</td>'+
						'<td><input class="btnEdit" type="button" value="ClickMe" data-id="{0}"></td>' +
                     '</tr>'+
    
  ...
  ...
  ...
    
 }
//custommob.css

.tblObj {
	width: 100vw;
	padding-right: 30px;
	white-space: nowrap;
	vertical-align: middle;
}

.btnEdit {
	float: right;
}

Работает.

Но... правильно ли я сделал или можно ещё лучше?

 

P.S. класс кнопки я переименовал + убрал точку. Теперь просто "btnEdit".

Link to comment
Share on other sites

в этом видео показано, как можно вставить значок

https://www.youtube.com/watch?v=8nSiep3XUws

но у меня не получается

config.itemTpl = new Ext.XTemplate('<table class="tblObj">'+ 
                     '<tr>'+
                        '<td style="color:#2c81aa">ID {0}, ID на сайті: {13}</td>'+
						'<td><input class="btnEdit ico-edit" type="button" value="ico-edit" data-id="{0}"></td>' +

Подключил css (тот что приложил к этому сообщению).

Добавил "ico-edit", но на кнопке вижу только надпись "ico-edit".

Да ещё и стандартные значки UniGUI перестали отображаться :(

icons-fa.css

Screenshot_3.jpg

Link to comment
Share on other sites

On 5/22/2020 at 4:10 PM, Sherzod said:

'<td><input class=".btn1" type="button" value="ClickMe" data-id="{0}"></td>' +

 

'<td><button class="btn1" data-id="{0}"><i class="fas fa-edit"></i> ClickMe</button></td>'+

 

delegate: 'table button'

 

  • Like 1
Link to comment
Share on other sites

  • 11 months later...
On 5/23/2020 at 9:03 PM, Sherzod said:

delegate: 'table button'

 

 

Подскажите пожалуйста, что может быть не так?

Сделал еще одну форму и в этой в этой другой форме я использовал не table/td/tr, а DIVы в шаблоне.

Кнопка на форме есть, но при нажатии на неё ничего не происходит, т.е. ajaxRequest на сервер не отправляется.

Может в delegate: 'table button' дело?

Спасибо.

 

 

Screenshot_3.jpg

Screenshot_2.jpg

  • Like 1
Link to comment
Share on other sites

16 minutes ago, x11 said:

Может в delegate: 'table button' дело?

Не знаю, правильно ли это, я заменил на

delegate: 'button'

пока что работает...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...