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. Image for the cookie policy date
close icon

EditType property values

Could you please reference the values for the editType property?[editType]="boolean" doesnt seem to work.

5 Replies

RA Rykunov Alex February 6, 2017 11:43 AM UTC

A little bit more detail. I have the following grid:

<ej-grid id="Grid" [dataSource]="activityTypes" [allowSorting]="true" [allowFiltering]="true"
        [editSettings]="{'allowEditing':'true', 'editMode':'batch'}" [allowPaging]="true">
        <e-columns>
            <e-column field="id" [isPrimaryKey]="true"></e-column>
            <e-column field="name" headerText="Название" ></e-column>
            <e-column field="status" [editType]="CheckBox" headerText="Статус"></e-column>
        </e-columns>
</ej-grid>

I want the status field in edit mode to be a checkbox. EditType property seem to be doing that. However, whenever I click the cell (activate edit mode) I can see only the textbox with "false" or "true" written.

It would also be nice, if the inner checkbox, that's used for editing would've been identical to the outer 'view' checkbox.



RA Rykunov Alex February 6, 2017 12:23 PM UTC

This is not entirely on theme, however:

It seems that there's a problem with dropdowns and boolean types. I've created the following column, that stores boolean type:

<e-column field="status" [editType]="Dropdown" [editParams]="{'showPopupOnLoad':true}" foreignKeyField="value" foreignKeyValue="text" [dataSource]="statusTitles" headerText="Статус"></e-column>

The statusTitles:

this.statusTitles.push({text: "Active", value: true});
this.statusTitles.push({text: "Not active", value: false})

The problem is in that with this code when cell gets in edit mode, the dropdown selected value is absent. I believe that happens because the value of dropdown list and value in the input do not match. Why? I think, that when the boolean type of 'status' gets in the textbox, it becomes the 'string' type. And, i presume, the dropdown takes the value right out of the textbox, instead of taking some kind of internal value, that is still boolean type. So, the dropdown gets string, and expects boolean, so he cannot match two values.

Well, an easy solution would be just make statusTitles value a string? It does not work either. I suppose, that the status field expects boolean. When dropdown value is selected, it is pushed directly into the field. Again, field expects boolean, and gets string, the values do not match.


PK Prasanna Kumar Viswanathan Syncfusion Team February 7, 2017 02:05 PM UTC

Hi Alex, 

Thanks for contacting Syncfusion support. 

      Queries 
                                                 Response 

Could you please reference the values for the editType property?[editType]="boolean" doesnt seem to work.” 


In this if you need an checkbox while editing the cell, mention editType as “booleanedit” in the particular column.  

Find the code example:  

<e-columns> 
        <e-column field="OrderID" headerText="Order ID" width="75" textAlign="right" ></e-column>        
        <e-column field="EmployeeID" headerText="Employee ID" width="75" textAlign="right"></e-column> 
        <e-column field="Verified" headerText="Verified" editType ="booleanedit" ></e-column> 
    </e-columns> 

Refer to the Help document. 



It seems that there's a problem with dropdowns and boolean types” 



In our sample when we used ForeignKey column the text values is shown in dropdown when the cell in editMode. So, we unable to reproduce the mentioned issue at our end. 

To find out the root cause we need the following details 

1. Ensure that  ForeignKey dataSource is bounded to the particular column.  

2. Do you face any script error in console when you edit the particular cell? If yes, share the screenshot and stackrace of an issue. 

3. When the cell in editMode, are you expecting to display boolean value(true or false) in the textbox and in dropdown?  

4. Essential Studio Version details.  

Find the code example, screenshot and sample:  


<e-columns> 
        <e-column field="OrderID" headerText="Order ID" width="75" textAlign="right" ></e-column>        
        <e-column field="EmployeeID" headerText="Employee ID" width="75" textAlign="right"></e-column> 
        <e-column field="Verified" headerText="Verified" width="110" foreignKeyField="value" foreignKeyValue="text" [dataSource]="statusTitles" [editParams]="{'showPopupOnLoad':true}" ></e-column> 
    </e-columns> 
 
---------------------------------------------- 
public statusTitles = [{ 
        text: "Active", 
        value: true 
    }, { 
        text: "Not Active", 
        value: false 
    }]; 

Screenshot:  

 


If we misunderstood your query, please get back to us.  



Regards, 
Prasanna Kumar N.S.V 
 



RA Rykunov Alex February 8, 2017 05:33 AM UTC

Thank you for your response. 

While testing the issue I've noticed, that it is replicated only with editMode "batch". The editmode "normal" is working fine, just as you said.

1. Yes, the column ForeignKey is clearly bounded to datasource, as I can see the datasource values in dropdown.
2. No script errors
3. I am expecting the following behaviour: in the view mode field displays the "Active" or "Not active" value, that corresponds to 'true' or 'false' values the status property of the activityTypes datasource. In editMode the pre-selected value should be the one, that was displayed in the view mode — if it was "Active" the "Active value should be selected in the dropdown, if not, then "Not Active"
4. I am using ej-angular2 module of the 14.4.0.20 version

Here's the screenshots of the issue:

The field holds the correct value in view mode:



The field value dissapears as the field goes to viewMode:




TS Thavasianand Sankaranarayanan Syncfusion Team February 9, 2017 01:27 PM UTC

Hi Alex, 
 
For this query, we have updated the response in the Forum 128704, So please follow the forum for further updates. 
 
If we misunderstood your query and please get back to us. 
 
Regards, 
Thavasianand S. 


Loader.
Live Chat Icon For mobile
Up arrow icon