Hi Kendo Gurus,
I am have a really tough time with a binding issue and I am not sure if it is MVVM related or Template related. I will try and provide as much information as possible.
The binding is done via nested templates like this:
obsOccupants is an ObservableArray that is a child property to an ObservableObject, that is bound to a form and includes the below. The "s20-employees-list" template looks like this:
I do NOT believe that anything above is an issue as this binds and works just fine on initial load, ala (I'm hiding information so there are blanks):
Further, clicking the delete icon on the right (red trash can) "soft" deletes the row via the click event handler in the bindings (pictured above), resulting in this:
Clicking the undelete icon on the right (green trash can) also behaves as expected. This is done by updating the isDeleted property on an ObservableObject in the ObservableArray. Additionally, there are other, more complicated bindings that are working just fine in the same form, although no adds - this is the first.
So far so good and I thought I was on fire. But now, when I click the Add Occupant button, search for an employee (via a separate UI not pictured) and select an employee and add it to the Observable array, things go south.
The code to add to the Observable array looks like this, and I have tried all three permutations below (First Try, Second Try, etc.). The third one seems really stupid and I was hoping that would not be the answer. :D
All of these fire a bound change event as expected, and you can see that the count of obsOccupants has increased to 2 and the added employee is included in the event, ala:
So the new employee exists in the obsOccupants array, the count is correct but the HTML does not update, although as mentioned above, a change on any of the objects IN the Observable Array correctly updates the HTML..
I have tried simplifying the HTML as well as the bindings but still to no avail. Is there anything I should be looking for or trying?
Thankyou for any help.
Cheers,
Justin
I have started using Kendo GanttChart Asp.net MVC. I want to display two record on the same line. Is this feature available in Kendo GanttChart Asp.net MVC?
My requirement is attached.
Duplicate subfolder entries show up in the left-hand TreeView, when following these steps:
Steps to reproduce:
This is in version 2024.2.514, which is the latest as of now.
After testing the new paragraph and formatting marks toolbar selection, I am seeing a couple of issues when using this selection for inline editing. The first issue is that formatting marks are generated in all editors and across all elements on the html page, not just the selected editor. The second issue is that if the editor area is scrollable, the formatting marks do not scroll with the content and remain stationary.
Please see this Dojo for example of the issues:
https://dojo.telerik.com/AZosilAv
Thanks.
Is it possible to use HTML fragments in the legends.template (https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart/configuration/legend.labels#legendlabelstemplate)?
I tried several html tags (<span></span>, <br/>), but the template is rendered as clear text, not as html text. even the \n does not work :
config:
legend: {
position: "bottom",
labels: {
template:
function(e){
return '<span style="color: red;">' + e.text +'</span>';
}
}
}
result:
var gridName = <HTML_SELECTOR+NAME>,
gridURL = <SERVER_URL>,
columnNames = [{
template: "# if((uploaded_status =='Delete In Process')||(uploaded_status =='GSTN Delete Error')||(uploaded_status =='Saved')|(uploaded_status =='Submitted')|(uploaded_status =='Filed') ){} else { # <input type='checkbox' class='checkBoxClassInv' name='selectgst[]' value='#: data.gstin_of_customer #:#: data.invoice_no #'> #}#",
field: "gstin",
title: "<input type='checkbox' check-id='checkBoxClassInv' class='checkAllGrid'>",
filterable: false,
sortable: false,
groupable: false,
width: 30
}, {
template: "<div class='status #: uploaded_status #'>#: uploaded_status #</div>",
field: "uploaded_status",
title: "Status",
width: 100
}, {
field: "outwardvsgstr1_status",
title: "OutwardVsGstr1 Status",
width: 90
}, {
field: "invoice_category",
title: "Tran Type",
width: 100
}, {
field: "doc_type",
title: "Doc Type",
width: 100
}, {
template: "<span class='grid-align-left'>#: customer_name #</span>",
field: "customer_name",
title: "Customer Name",
width: 200
}, {
template: "<span class='invoice_no' >#: invoice_no #</span>",
field: "invoice_no",
title: "Doc No ",
width: 100
}, {
field: "invoice_date",
title: "Doc Date",
width: 100
}, {
field: "place_of_supply",
title: "POS",
width: 90
}, {
command: [{
text: " ",
name: "Details",
click: outwardInvoiceDetails,
iconClass: "k-icon k-icon-20 k-i-info m-r-0-imp op-1"
}, {
text: " ",
name: "Edit",
click: outwardInvoiceEditDetails,
iconClass: "k-icon k-icon-20 k-i-edit m-r-0-imp op-1",
visible: function (dataItem) {
if ((dataItem.uploaded_status == 'Deleted') || (dataItem.uploaded_status == 'Pending Response') || (dataItem.uploaded_status == 'Delete In Process') || (dataItem.uploaded_status == 'GSTN Delete Error') || (dataItem.uploaded_status == 'Saved') || (dataItem.uploaded_status == 'Submitted') || (dataItem.uploaded_status == 'Filed')) { } else {
if (outwardManualEntryConf == 1 && editable == 1) {
return true;
} else {
return false;
}
}
}
}],
title: "<span class='select'>Details</span>",
width: 130
}],
gridData = {
p_gstin: gstin,
return_period: fpdate
};
//below is kendo grid defination
$("#" + gridId).empty().kendoGrid({
dataSource: {
transport: {
read: {
url: <SERVER_URL>,
type: "POST",
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data: gridData,
dataType: "json"
}
},
schema: {
aggregates: serverAggregateConf,
model: modelConf,
parse: function (response) {
//schema response structure
},
total: function (count) {
// custom total page counter
}
},
error: function (response) {
dataSourceError(response);
},
serverPaging: serverpgination,
pageSize: defaultPageSize,
aggregate: aggregateConf,
serverAggregates: typeof (serverAggregateConf) == 'undefined' ? false : true
},
dataBound: function (e) {
//UI manipulations logic
},
scrollable: true,
change: function (e) {
//setting heights as per UI
},
dataBinding: function () {
srno = (this.dataSource.page() - 1) * this.dataSource.pageSize();
},
noRecords: {
//custom message if no message
},
height: 800,
groupable: groupableConf,
sortable: sortableConf,
columnMenu: columnMenuConf,
resizable: resizableConf,
pageable: pagingConf,
filterable: filterConf,
columns: gridColumns,
excelExport: excelConf,
excel: {
allPages: true
}
}).data("kendoGrid");
We have been using an older version of your libraries from 2021 and decided to update it to the current one.
We have a grid and we have been using server-side filtering/sorting/etc... In the old version there used to be syntax like this:
filter: RequestStatus~eq~1~and~PersonFullName~contains~'Steve'
We took this string, parsed, and processed the data. However, with the update, this is no longer the case. Now it looks like this:
And we are clueless on how to properly parse and or process this format on our back end.
This is the code that we use on the front end to query the back end.
gridDataSource = new kendo.data.DataSource({
serverFiltering: true,
serverGrouping: true,
serverSorting: true,
serverPaging: true,
serverAggregates:true,
pageSize: 25,
transport: {
read: {
url: __config.baseUrlAbsolute + "Requests/Home/GetCurrentViewRequests",
dataType: "json",
data: function () {
return {
type: requestTypesList[requestType],
id: personId,
};
}
}
},
});
})
Our backend is .NET MVC and this is the method that we have used to process the request. But this no longer works.
public string GetCurrentViewRequests([DataSourceRequest] DataSourceRequest request, int type, int id)
{
var filters = Request.Params.Get("filter");
var groups = Request.Params.Get("group");
var sorts = Request.Params.Get("sort");
//Process
}
Would you be so kind as to point us in the right direction on how to properly parse and process the request?