I used to have the previous version of ignite ui (2012). I had a grid that was functional with no problems.
columns: [ { headerText: headerTextValues[0], key: "cntID", hidden: true }, { headerText: headerTextValues[1], key: "cntAKA", width: 250, template: "<a class='editDialog' href='Home/ManageContact?cntID=${cntID}&command=edit'>${cntAKA}</a>" }, //{ headerText: headerTextValues[2], key: "cntRelation", width: 250, template: "<a href='Home/ManageContact?cntID=${cntID}&command=edit' class='editDialog'>${cntRelation}</a>" }, //{ headerText: headerTextValues[2], key: "cntRelation", width: 250, template: "<a href='javascript;' onclick='return show_more_menu(); class='editDialog'>${cntRelation}</a>" }, { headerText: headerTextValues[2], key: "cntRelation", width: 250, template: "<a href='Home/ManageContact?cntID=${cntID}&command=edit' class='editDialog'>${cntRelation}</a>" },
//{ headerText: headerTextValues[3], key: "cntRelation", hidden: true, width: 250, template: "<a href='FullPage/ManageContactInternal?cntID=${cntID}&command=edit' class='editDialogInternal'>${cntRelation}</a>" }, //{ headerText: headerTextValues[3], key: "hrefUrlTest", width: 250 }, ],
I had a link in the template as shown in the code above.
When I upgraded igniteui to the latest version (2014), the link is no longer functional.
I tried the link as a standalone (outside of the grid template) and it works with no problems but when trying it in the iggrid template it doesn't work.
Sonia
Hi Stamen,
Sure I will.
Thank you
Regards
Hello Sonia,
I am glad I was able to help. Please, let me know if I can be of further assistance!
Best regards,
Stamen Stoychev
Thank you for your response.
It worked as required.
Thank you for your help.
You could use a default sorting expression which will render the grid pre-sorted using it. To apply one add a column setting to your Sorting definition like this:
columnSettings: [ { columnKey: "someColumn", currentSortDirection: "asc" } ]
The column key should match the column you have "Myself" in unless you are using the simple custom sorting function I suggested in which case you can put any of your columns there. The only difference will be for which column the sorting indicator would appear.
I am attaching a modification of my original sample which demonstrates this approach.
I applied the idea to my project and it works. But what I really want to achieve is to have this functionality without the need to click on the header of the column to sort the data.
What I want to achieve is : when the data is binded to the grid after adding/deleting/editing a row using the external editor, the data is automatically sorted, which means the value "Myself " is always placed at the first row. Is this possible to achieve ?
I tried the following but it didn't work : (even with simple alerts to see if I can get the data in the columns so I can sort them, the alerts didn't work as well)
$(document).delegate("#grid", "iggridrowsrendered", function (evt, ui) {
// //return reference to igGrid // var i, w, grid = ui.owner, // //return grid's table body DOM element // tbody = ui.tbody, // ds = grid.dataSource, // data = ds.data(), // dataLength = data.length;
// //var coutRows = ("#grid").data("igGrid").dataSource.dataView().length; // var dataView = $('#grid').data('igGrid').dataSource.dataView(); // var countRows = $("#grid").data("igGrid").dataSource.dataView().length;
// var rows = $("#grid").igGrid("rows");
// if (dataLength >= 1) {
// //if (dataView[0]["Relation"] === "Myself") { // alert(data[0]);
// //} // } // /*else {
// alert("not here"); // }*/
// //alert(dataView[0]["Relation"]);
// //$.each(rows, function (i, val) {
/***********************Find the index of the row and placed at first place***************************/
// // if (dataView[val.index]["Relation"] === "Myself") {
// // alert("found" + val.idex);
// // }
// // //alert("found" + dataview[val.index]["cntID"]);
/***********************Find the index of the row and display it***************************/
// // if (dataView[val.index - 1]["Relation"] === "Myself") {
// // alert(val.index); // // }
// //});
// });
//alert(dataView[0]["Relation"]); //alert(tbody[0]);
//});
Please let me know if I need to explain more.