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
Hello Sonia,
Thank you for using Infragistics forums!
I've tried reproducing the issue you are experiencing with a simple sample but was unable to. Could you please provide more info about your grid's setup (such as the enabled features) and what exactly the the problem with the links is? Is the URL wrong, are they not appearing at all or perhaps they cannot be clicked. A small sample reproducing the issue on your end will help immensely.
I am looking forward to hearing from you!
Best regards,
Stamen Stoychev
Hi Stamen,
Thank you for your prompt answer.
The link and code are correct because I didn't change them. They used to work with no problems before upgrading igniteui.
I wanted to track the error and find where is it exactly and I could identified. The problem is that the link wrote in the template has a class/id, when I try to refer to that class/id from a simple jquery script from outside the definition of the grid, this class/id is not detected.
I attached a sample.
In my example I created a template that calls the http://google.ca (column 1) and another one that calls an action from the controller (column 2)
The links work fine when clicked but the problem is that when I want to refer to the <a></a> tag using its class/id and write a simple alert message (please check the end of the code attached) when that link is clicked, this is not possible. I want to mention again that I start having this problem after upgrading the ignite ui.
Please let me know if I need to explain more.
Regards
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]);
//});
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.
Thank you for your response.
It worked as required.
Thank you for your help.
I am glad I was able to help. Please, let me know if I can be of further assistance!
Sure I will.
Thank you