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.

Edit cell with template

Thread ID:

Created:

Updated:

Platform:

Replies:

119002 May 3,2015 10:05 AM May 4,2015 09:20 AM JavaScript 1
loading
Tags: ejTreeGrid
Edgar Ricardez Peralta
Asked On May 3, 2015 10:05 AM

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


Mahalakshmi Karthikeyan [Syncfusion]
Replied On May 4, 2015 09:20 AM

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.


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.

;