searchBuilder with serverside scripting without using editor library
searchBuilder with serverside scripting without using editor library
sarooptrivedi
Posts: 62Questions: 19Answers: 2
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem: Is it possible that to use searchBuilder for serverside scripting without using editor library in .net core. My company allow us to use datatables.net but not it's editor library. I could not find single example. please give some small example.
Answers
The Editor server-side scripts are open-source. Is there a reason why you don't want to use them? Here is an example with Editor, but the same example would work the same without the Editor functionality on the client. This blog post explains the process in more detail,
Colin
Is it paid version? My company only approve free free free.
I tried the Library but it is not quite mature. Some of my observation.
https://datatables.net/forums/discussion/comment/195203/#Comment_195203
public class ClassA
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Key]
public int ID { get; set; }
public string Name { get; set; }
public ClassB Items{ get; set; }
[ForeignKey("Id")]
public int ClassBId{ get; set; }
public ClassC Product{ get; set; }
[ForeignKey("Id")]
public int ClassCId{ get; set; }
}
public class ClassB
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Key]
public int Id { get; set; }
public string Name { get; set; }
}
public class ClassC
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Key]
public int Id { get; set; }
public string Name { get; set; }
}
My final expectation is Id,Name,ClassB.Name,ClassC.Name
If you can help me with Controller Code with Editor library then great help.
Hi @sarooptrivedi ,
ID
,Id
orid
.Without knowing more about your database I would guess that your controller is going to look something like this...
... assuming your tables are called 'ClassA', 'ClassB' and 'ClassC'?
Hopefully this can get you on the way to working something out. I'd strongly suggest that you work through the blog post.
I followed your instructions already but still have same ID issue.
One more observation what is your overall design in response. How I design the expected Json outside without using your all query function. is there any specific structure require to write the datatable?
This is my code sample
What is require in Json? Should I design outside without complex query? What is Json structure required. Below my actual code. I just change the tables name
The SearchBuilder docs include information on the data being sent to, and received from the server. Specifically it notes that the data submitted is defined by
searchBuilder.getDetails()
.The response from the server is defined here and as the docs note:
Allan