Hi,
Yes, of course. Here are the steps you can follow to achieve it.
First of all define a custom field to your resourceStore for toggling lockRows with checkcolumn
resourceStore : {
// Custom fields used on resources in the demo
fields : [
{ name : 'fixed', type : 'boolean', defaultValue : false }
]
},
And now you can set that field to lockRows feature
lockRows : {
fieldName : 'fixed'
}
And then you can add the column with that field
{ field : 'fixed', type : 'check', width : 100 }
And then you should be good to go.
Here is the whole code I used
// Scheduler filters "backlog" resource to the top.
new Scheduler({
appendTo : 'container',
startDate : new Date(2023, 0, 29),
endDate : new Date(2023, 1, 12),
viewPreset : 'weekAndDayLetter',
rowHeight : 100,
tickSize : 75,
crudManager : {
autoLoad : true,
eventStore : {
// Custom fields used on events in the demo
fields : [
'description',
{ name : 'percentDone', type : 'number', defaultValue : 0 },
]
},
resourceStore : {
// Custom fields used on resources in the demo
fields : [
'city',
{ name : 'fixed', type : 'boolean', defaultValue : false }
]
},
loadUrl : 'data/data.json'
},
features : {
group : false,
columnLines : false,
eventDrag : {
constrainDragToTimeline : false
},
lockRows : {
fieldName : 'fixed'
},
nonWorkingTime : true,
stickyEvents : false
},
columns : [
{ field : 'name', text : 'Name', width : 150 },
{ field : 'city', text : 'City', width : 150 },
{ field : 'fixed', type : 'check', width : 100 }
],
eventRenderer({ eventRecord, resourceRecord, renderData }) {
// Add a progress bar to the event bar
renderData.children.push({
className : 'progress',
style : {
width : `${eventRecord.percentDone}%`
},
children : [
{
className : {
percent : true,
hasValue : eventRecord.percentDone
},
text : `${eventRecord.percentDone}%`
}
]
});
// "Unfinished" part of the par, for styling purposes
renderData.children.push({
className : 'remaining',
style : {
width : `${100 - eventRecord.percentDone}%`
}
});
// Events displayed in the top scheduler (backlog) are styled differently
if (resourceRecord.id === 'backlog') {
renderData.eventColor = 'gray';
renderData.cls += 'backlog-event';
}
// Event contents
return [
{ className : 'name', text : eventRecord.name },
{ className : 'desc', text : eventRecord.description }
];
}
});
Hope it helps.
Good Luck ,
Tasnim