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.
Syncfusion Feedback

Method to select row by task id.

Thread ID:

Created:

Updated:

Platform:

Replies:

124169 May 23,2016 04:22 AM May 24,2016 08:46 AM JavaScript 1
loading
Tags: ejGantt
Anton Goldovsky
Asked On May 23, 2016 04:22 AM

Could you add "selectRowByTaskId" method to Gantt component. It would be useful for me.

Mahalakshmi Karthikeyan [Syncfusion]
Replied On May 24, 2016 08:46 AM

Hi Anatoliy, 
Thanks for contacting Syncfusion support. 
At present there is no built in support to select a row by its taskId. So we have logged feature report regarding this. A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates. 
But we can provide work around solution for this now by getting index of the row with its taskId then selecting the row using setModel. Please refer the below code example for details. 
 
   Enter TaskId to select:  <input type="text" id="taskid" /> 
   input type="button" id="selectrow" value="Select Row" onclick="funcSelectRow();" /> 
   <div id="gantt" style="height:350px;width:100%;"></div> 
    
   <script type="text/javascript"> 
        $(function () { 
 
            $("#gantt").ejGantt({ 
                //… 
            }); 
        }); 
        function funcSelectRow(args) { 
            var obj = $("#gantt").data("ejGantt"), 
                model = obj.model, 
                searchItem = document.getElementById('taskid').value, 
                results = model.updatedRecords, 
                index = -1; 
            filterindex = results.some(function (record) { 
                if (record.item.taskID == searchItem) { 
                    index = record.index; 
                    return true; 
                } 
            }); 
            obj.option("selectedRowIndex", index); 
            obj._$treegridHelper.ejTreeGrid("updateScrollBar"); 
        } 
    </script> 
We have also prepared a sample based on this and you can find the sample under the following location 
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.

Warning Icon 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.Close Icon

;