vendredi 2 novembre 2018

kendo directive for anuglarjs how to update record with id and go to update page?

I have taken the id from selected field in kendo grid, and I am using angularjs directive. Now I don't understand how to update the selected Id record. I mean to say with the selected Id I want to go to update page. The work I have done is given below.

 (function () {
angular.module('moduleName').directive('kendoGridRowDblClick', kendoGridRowDblClick);

function kendoGridRowDblClick() {
    return {
        link: function (scope, element, attrs) {
            scope.$on("kendoWidgetCreated", function (event, widget) {

                if (widget !== element.getKendoGrid())
                    return;

                attachDblClickToRows(scope, element, attrs);

                //element.data("kendoGrid").bind('dataBound', function () {
                  //  attachDblClickToRows(scope, element, attrs);
                //});
            });
        }
    };

    function attachDblClickToRows(scope, element, attrs) {
         var id = $(element).find(".k-state-selected td:eq(1) span").html();
     console.log($(element).find(".k-state-selected td:eq(0) span").html());   
    }
})();

With td:eq(1) it gives me the correct id when I dblclick on a record in a grid, With console.log it gives me the span value which is given below, and i want to take the id and go to the new state for updating page. I have defined the span here which is hidden field

{field: "", hidden: true, template: "<span>Akhtar</span>"},

And ofcourse I have database fields too, but here I just want to go to an update state/page instead of just printing the span value Akhtar in console. Any help would be appreciated. Thanks in advanced



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire