Clone a Grid and navigation into a form

Hi, 
I am having two little issue with Grid on ASP.NET MVC (ej1)

First Issue :

I have a view VISUALISATION, that show me a grid ("GridPassword")


This one is for a visualisation, users can't acces to the Edit mode of it if they don't have the admin rights.

My problem refer to an other Gird in my view EDITION, I have a  Button Edit that show the EDITION view, when i am on VISUALISATION view, and when I acces on EDITION View (from the button Edit), the Edit Button disapear and two Buttons get available : a Button that saves the edit, or a Cancel Button , both of this two redirect me to the VISUALISATION View when they are pressed.
When you are admin you have right to acces to the Edit mode and so, you can edit the grid. (the "Valeur" 's Cell), 

Anyway, The problem is, that i would like that my GridPasswordsEdit will get clone on the Grid in Visualisation's view.
But, the clone isn't effective, it only edit the grid in my Edition view and not the Visualisation one too.

I would like to know if you may have an .API or something that could clone my gridEdit on my GridView, and not just an export's api to convert on PDF, etc.


Second Issue :  

I have (same as the previous issue) a form with two view (visualisation and edition), the form is a succession row/colums that have some <div> Html.Ej().MaskEdit </div> some  <div> Html.Ej().Autocomplete </div>  and some <div> Html.Ej().Dropdownlist </div> 
i would like to know if you have an idea of how to set a custom Tab Navigation 
Actually it's like the Blue Color Order one, after a while the selection disapear and reapear later after some press of the TabKey, and i would like to have the navigation passing in the Red Color Order


If i missed some words i'm sorry, and hope you will understand my requests anyway

Thanks per advence for the reply, 
Kind Regards,
Marion

5 Replies 1 reply marked as answer

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team August 4, 2020 03:30 PM UTC

Hi Marion, 

Thanks for contacting Syncfusion Support. 
 
Query#:- Anyway, The problem is, that i would like that my GridPasswordsEdit will get clone on the Grid in Visualisation's view.
But, the clone isn't effective, it only edit the grid in my Edition view and not the Visualisation one too. When you are admin you have right to acces to the Edit mode and so, you can edit the grid. (the "Valeur" 's Cell), 
 
 
We have checked your query and we have achieved your requirement using EditTemplate feature of the Grid. Using EditTemplate property of the Grid column, we have placed the Visualization(as like password) input and maintained the same while on Editing. Based on the condition, we have permitted edit access to that particular row using BeginEdit event of the Grid. Using QueryCellInfo event, we have display the password (as like asterisk). 
 
Refer to the code example:- 
@(Html.EJ().Grid<OrdersView>("Edittemplate") 
       .Datasource((IEnumerable<object>)ViewBag.datasource) 
        
       .ClientSideEvents(eve => 
        { 
            eve.QueryCellInfo("queryCellInfo"); 
            eve.BeginEdit("beginEdit"); 
        }) 
       .AllowPaging() 
       .Columns(col => 
       { 
           col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(90).ValidationRules(v => v.AddRule("required", true).AddRule("number", true)).Add(); 
           col.Field("ShipCountry").HeaderText("ShipCountry").Width(90).EditType(EditingType.DropdownEdit).EditTemplate(a => { a.Create("create").Read("read").Write("write"); }).Add(); 
       }) 
) 
} 
<script type="text/javascript"> 
    function create() { 
        return $("<input type='password' >"); 
    } 
 
    function write(args) { 
        args.element.val(args.rowdata.ShipCountry); 
    } 
 
    function read(args) { 
        return args.val(); 
    } 
    function queryCellInfo(args) { 
        if (args.column.field == "ShipCountry") { 
            args.cell.innerText = "*********"; 
        } 
    } 
 
    function beginEdit(args) { 
        if (!args.rowData.Verified) {     // use your customized condition here 
            args.cancel = true;        //prevented Editing based on any condition 
        } 
    } 
 
</script> 
     
 

 
Note:- If you are using BatchEdit mode, you can use CellEdit event instead of beginEdit to prevent access for particular users. 
 
 

Refer to the API Link:- 

Query#2:- i would like to know if you have an idea of how to set a custom Tab Navigation  
 
We have checked your query and using keycode for Tab key we can customize the Keyboard Navigation. From using editCell method you can navigation to your desired field. Refer to the code example:- 

  <script type="text/javascript"> 
       $("#Edittemplate").on("keydown", function (e) { 
               if (e.keyCode === 9) {  
                  var gridObj = $("#Edittemplate").data("ejGrid"); 
                  gridObj.editCell(2, "OrderID");   //You can use your own customized functionalites on pressing Tab Key 
             } 
       }); 
    </script> 


If your requirement is different from above, please share us Grid code example, detailed Explanation to proceed further. 
 
Regards, 
Farveen sulthana T 



MA Marion August 6, 2020 09:29 AM UTC

Hi ! 

Thanks for the reply, but i think you didn't understand my questions (or maybe it's me who don't understand your reply, in that case, sorry) :x 

It's TWO different grids, from different <div> but only one can get edit from admin, the other has to be the cloned one , is the api you linked is identical for two grids that need to be cloned ? 

for the tab navigation it's not for the grid, it's for a list of div for a form who is set like the screen, the code looks like : 

<div class="row">
            <div class="col-5">
                    <div>Sexe :</div>
                    <div class="InputSpan">
                        @Html.EJ().RadioButton("Homme" + Model.id).Name("SEXE" + Model.id).Size(RadioButtonSize.Medium).Checked(false).Enabled(true).Text("Homme").................
                        @Html.EJ().RadioButton("Femme" + Model.id).Name("SEXE" + Model.id).Size(RadioButtonSize.Medium).Checked(false).Enabled(true).Text("Femme").....................
                    </div>
            </div>
          <div class="col-5">
           @(Html.EJ().DropDownList("Civilite" + Model.id).Datasource((IEnumerable<  ...................
          </div>
</div>
<div class="row">
          <div class="col-2" id="date_naissance@{@Model.id}" style="top: -11px;">
                @Html.EJ().CheckBox("ChckNaissance" + Model.id).Text("Date de naissance").Checked(false)
                <div class="InputSpan">
                    @Html.EJ().DatePicker("DTPNAISSANCE" + Model.id).DateFormat("dd/MM/yyyy").Locale("fr-FR").ShowTooltip(true).ButtonText("Aujourd'hui").WatermarkText("").HtmlAttributes(NameDateNaissance).CssClass("NuanceInput")
                </div>
            </div>
            <div class="col-2" id="Affiche_Rang_naissance@{@Model.id}" style="top: 11px;">
                <div class="InputSpan">
                    @Html.EJ().NumericTextbox("RangNaissance" + Model.id).WatermarkText("").MinValue(1).MaxValue(8).HtmlAttributes(NameRangNaiss).CssClass("NuanceInput").ShowSpinButton(false).ClientSideEvents(cse => cse.FocusOut("Id_RangNaissance_FocusOut" + Model.id))
                </div>
            </div>
</div>
<div class="row">
            <div class="col-6">
                <div class="InputSpan">
                    @Html.EJ().MaskEdit("NOM" + Model.id).WatermarkText("").Width("100%").ClientSideEvents(e => e.Change("Ident_Nom_Change" + Model.id)).HtmlAttributes(NameNom).CssClass("NuanceInput")
                </div>
            </div>
            <div class="col-6" id="VOIE@{@Model.id}">
                <div class="InputSpan">
                    @Html.EJ().MaskEdit("VOIE" + Model.ide).WatermarkText("").Width("100%").HtmlAttributes(NameAdresseRue).CssClass("NuanceInput")
                </div>
            </div>
</div>


FS Farveen Sulthana Thameeztheen Basha Syncfusion Team August 7, 2020 03:16 PM UTC

Hi Marion, 

Query#:- It's TWO different grids, from different <div> but only one can get edit from admin, the other has to be the cloned one , is the api you linked is identical for two grids that need to be cloned ?  
 
We have checked your query and we can use same model properties for both Grids using GridProperties class as like below documentation Link:- 

Query#2:- for the tab navigation it's not for the grid, it's for a list of div for a form who is set like the screen 
 
By default while using EditForm we can navigate through Tab and you can perform customization on pressing Tab as like provided in the previous update.  Also we suspect that from your we understood that you need to navigate between the Grids on pressing the Tab key when both of the Grids on EditMode.  

In order to achieve that while on pressing TabKey, we have get the lastRow cell of the Grid from getCurrentViewData method and bind focusout event to the Grid. On focusout event we have set focus for the next Grid editForm’s td on Tab navigation. 

@(Html.EJ().Grid<OrdersView>("Grid") 
       .Datasource((IEnumerable<object>)ViewBag.datasource) 
       .    .    . 
) 

script type="text/javascript"> 
         $("#Grid").on("keydown", function (e) {  
               if (e.keyCode === 9) {   
                       var gridObj = $("#Grid").ejGrid("instance"); 
                       $(gridObj.getRows()[gridObj.getCurrentViewData().length-1]).find('td').last().focusout((function () {  
                         var grid = $("#Grid2").ejGrid("instance"); 
                         grid.element.find(".gridform").find("td :eq(1)").focus() 
                }));  
             }  
</script>  


If your requirement is different from above, share us the following details 

  1. Share detail Explanation of your requirement.
  2. Video Demo to achieve this requirement.
  3. Do you want navigation between two Grids


Regards, 
Farveen sulthana T 


Marked as answer

MA Marion August 13, 2020 07:25 AM UTC

Hi,

Thanks for your reply,

I'm gonna try that, 
By the way for the second issue, it's really not a navigation into a grid it's for something like this : 




FS Farveen Sulthana Thameeztheen Basha Syncfusion Team August 14, 2020 02:39 PM UTC

Hi Marion, 

We are pretty unclear about your requirement. Before proceeding with this, we need few more additional details to find the cause of the issue. Share the following details with us. 

  1. Do you want to Implement Tab navigation in Grid EditForm or your own customized Form(which is only Form not EJGrid).
  2. Share any Video Demo to replicate the issue/requirement(If possible).
  3. Detailed Explanation of your requirement.
  4. Have you placed the Form inside Grid or its separate Form(Share complete code).
 
Regards, 
Farveen sulthana T 


Loader.
Up arrow icon