We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

how to load template for add or edit record in for grid in partial view

Thread ID:

Created:

Updated:

Platform:

Replies:

119327 Jun 5,2015 07:31 AM Jun 8,2015 06:28 AM JavaScript 2
loading
Tags: ejGrid
Gomtesh
Asked On June 5, 2015 07:31 AM

I have to do when  for edit and add record in grid  i have to load adding record template in partial view in place of grid view

i. e. in place of grid view i have to load add record template and dont want to show grid and after save click on template i have to load that grid with added new record




Gomtesh
Replied On June 5, 2015 07:35 AM

I have to do when  for edit and add record in grid  i have to load adding record template in partial view in place of grid view

i. e. in place of grid view i have to load add record template and dont want to show grid and after save click on template i have to load that grid with added new record




please suggest solution only using AngularJS 

Alan Sangeeth S [Syncfusion]
Replied On June 8, 2015 06:28 AM

Hi Gomtesh,

Thanks for using Syncfusion products.

We are glad to let you know that we have created a sample based on your requirement and the same can be downloaded from below link.

Sample: http://www.syncfusion.com/downloads/support/forum/119327/ze/Simple_JS_sample1398869491

In the above sample we have included Editing template from partial view using “ng-include” angular directive. And then using angular “ng-show” directive and “actionBegin” Grid event we have hidden/shown Grid and Edit template. Please refer the following code snippets.

<div ej-grid id="gridID" e-datasource="data" e-columns="columns" e-actionbegin="editHandler">

            </div>

        </div>

        <div ng-if="leadview">

            <div ng-include="'EditTemplate.html'">

            </div>


        </div>



<script>

$scope.gridpage = true;

$scope.leadview = false;


$scope.editHandler = function (args){

if(args.requestType =="add" || args.requestType =="beginedit"){

var data = $.extend({},this.model.currentViewData[args.rowIndex]);

$scope.editData = data;

$scope.$apply(function(){

$scope.gridpage = false;

$scope.leadview = true;

});

args.cancel = true; // to prevent default action

}

                                      }



Please let us know if you need any further assistance.

Regards,
Alan Sangeeth S

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;