andyhill Posted November 7, 2017 Posted November 7, 2017 Hi, I am trying to add a CheckBox to a Grid PagingBar (all good so far) and now need an Ajax Notification Change Listener - please advise - Thanks in advance. function pagingBar.afterCreate(sender) { sender.add([ { xtype: 'tbseparator' }, { xtype: "checkboxfield", fieldLabel: '', labelWidth: "0px", inputValue: '0', id: "checkboxID", width: 20, listeners: { change: function(el, v) { ajaxRequest(sender, "_checkboxChange", ["val=]) } } } ]); } ... procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if SameText(EventName, '_checkboxChange') = True then begin ShowMessage('Hi'); //SHOW CHECKBOX STATE (Checked/UnChecked) HERE end; end; Quote
Sherzod Posted November 7, 2017 Posted November 7, 2017 Hi, Try this: 1. ... change: function(el, v) { ajaxRequest(sender, "_checkboxChange", ["val=" + v]) } ... 2. procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); var _checked: Boolean; begin if SameText(EventName, '_checkboxChange') = True then begin _checked := StrToBool(Params.Values['val']); ShowMessage(BoolToStr(_checked)); end; end; Best regards, Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.