onBeforeEdit: function (row) { let options = $(this).treegrid('options'); options.tempeditor = options.tempeditor || {}; let getColumnOption = $(this).treegrid('getColumnOption', 'sampleTypeId'); if (!options.tempeditor["sampleTypeId"]) { options.tempeditor["sampleTypeId"] = getColumnOption.editor; } if (row.parentId) { getColumnOption.editor = undefined; } else { getColumnOption.editor = options.tempeditor["sampleTypeId"]; } }