Error using Options.Add() function
Error using Options.Add() function

I have the following code designed to pull in a list of employees:
editor.Field(new Field("REFERRAL.Referee_EmployeeID").SetFormatter(Format.NullEmpty())
.Options(new Options().Table("EMPLOYEE").Value("EmployeeID").Label(new[] { "FirstName", "LastName", "EmployeeID" })
.Render(row => string.Format("{0} {1} ({2})", row["FirstName"], row["LastName"], row["EmployeeID"])).Add("No Referee", null)));
I am attempting to use the .Add functionality to add a custom static option as per the following documentation:
https://editor.datatables.net/manual/net/options#Add()
However when doing so I receive the following error:
Not sure if I'm using this incorrectly or if there is something else wrong.
Thanks for any assistance, let me know if I can provide additional information.
This question has accepted answers - jump to:
Answers
Hi,
I'm afraid you've found an error in the changes I made for the Options in Editor 2.2 there. The intention had been for the manually added options to be passed through the label renderer, but that isn't suitable in this case since you already have the label and value, they just need to be added!
I've committed a fix that will address this. You are welcome to build the dll form that repo, or I can send you an updated dll if you like? I suspect it will be 2-3 weeks before the next patch release of Editor (this is the first change since 2.2.1).
Thanks for letting me know about this error.
Allan
Hey @allan,
As always thanks for the quick response
If you wouldn't mind sending me the updated DLL that would be great. Currently using .NET 4.7
Hey @allan,
As a follow up, I attempted to build the DLL on this and am receiving the following error:
Added the
on that one to resolve, but not sure that's what you would want there or not
Doh! Fixed now (not certain why it compiled for me with that error, but yes, that change is needed).
I'll PM you with the dll I've built.
Allan