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

Edit cell with template

Hi Syncfusion,

Yo tengo unas preguntas sobre el control ejTreeGrid

  1. How to I can edit the value of a cell using a template?
  2. If the template has several controls, How to I can display only one value in the cell grid?
  3. I have a grid where the columns are the months of the year, How to I can enable the capture of columns whose month is equal to or less than the current month?

Thanks in advance


1 Reply

MK Mahalakshmi Karthikeyan Syncfusion Team May 4, 2015 01:20 PM UTC

Hi Edgar,

Thanks for using Syncfusion Products.

We have analyzed your queries.

Query 1: How to I can edit the value of a cell using a template?

Soluntion: We would like to let you know that we can enable the editing in the treegrid please refer the following code snippet.

<script type="text/x-jsrender" id="customColumn">

//…

<p>{{:#data['fieldValue']}}</p></div>

</script>

$("#TreeGridContainer1").ejTreeGrid({

editSettings: {

allowEditing: true,

editMode: "cellEditing"

},

columns: [

{ field: "fieldValue", headerText: "Custom Column", isTemplateColumn: true, templateID: "customColumn" },

//…

],

//…

})

Also we have to provide the appropriate field value in the template to enable editing for that cell.

We have also prepared sample for column Template and enabled editing. You can find find the sample under the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/119002/ColumnTemplate-360911471.zip

Query 2: If the template has several controls, How to I can display only one value in the cell grid?

Solution: please share us more details about this query to help you better. Whether you using column Template or Row Template? can you please share us more details about controls you are using in treegrid cell.

Query 3: I have a grid where the columns are the months of the year, How to I can enable the capture of columns whose month is equal to or less than the current month?

Solution: we would like to let you know that we can hide and show the columns using hideColumn() and showColumn() public methods in treegrid. Please refer the following code snippet for details.

$("#greaterMonth").click(function () {

treeObj = $("#TreeGridContainer1").data("ejTreeGrid");

//…

treeObj.hideColumn("January");

})

$("#allColumns").click(function () {

treeObj = $("#TreeGridContainer1").data("ejTreeGrid");

//…

treeObj.showColumn("January");

})


We have also prepared a sample based on your query. Please find the sample under the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/117557/Months-179564165.zip

Please let us kow if you need further assistance on this.

Regards,

Mahalakshmi K.


Loader.
Live Chat Icon For mobile
Up arrow icon