Mjoined Alias fails on server side processing

Mjoined Alias fails on server side processing

ameji012ameji012 Posts: 8Questions: 2Answers: 0

Error messages shown:
error: "Unknown field: manager (index 5)"
Description of problem:
Were asking the client block to perform server-side processing to reduce the amount of data pulled, so initially we had data: null. Changing this it does not seem to accept "manager" as a field not if we change it to manager[].employee any ideas?
Client Code Block

{
                    data: 'manager',
                    render: "[, ].employee"
                },

Server Code block

var editor = new Editor(db, "dimension", "dimension.id")
                .Model<dimension>("dimension")
                .Model<dimensionChangeStatus>("dimensionChangeStatus")
/*continued/...*/
 .MJoin(new MJoin("employee")
                    .Name("manager")
                    .Link("dimension.id","dimensionEmployeeManager.dimensionId")
                    .Link("dimensionEmployeeManager.employee","employee.employee")
                    .Model<employee>()
                    .Validator("employee[].employee", Validation.MjoinMaxCount(11, "No more than four selections please"))
                    .Order("employee.LAST_NAME")
                    .Field(new Field("employee")
                        .Options(new Options()
                            .Table("employee")
                            .Label(new[] { "FIRST_NAME", "LAST_NAME" })
                            .Render(row => row["FIRST_NAME"] + " " + row["LAST_NAME"])
                            .Value("employee")
                            .Where(r =>
                                r.Where(s => {
                                    s.Where("R_COUNT", "2", "=");
                                    //s.Where("POSITION".Substring("POSITION".Length - 1, 1), "1", "=");
                                    s.Where("SUBSTRING(POSITION,LEN(POSITION),1)", "0", "!=");
                                    }
                                )
                            )
                        )
                    )
                )

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    MJoin columns with server-side processing need to be marked as not searchable (columns.searchable) and not orderable (columns.orderable). Do you have that configuration for your table?

    Allan

  • ameji012ameji012 Posts: 8Questions: 2Answers: 0

    Thank you Allen we did not mark them w/ this flag. Is there a native workaround that would allow them to be searched?

  • ameji012ameji012 Posts: 8Questions: 2Answers: 0
    edited January 2022

    Following up I can fix any additional errors by also adding the option of defaultContent set to blank.

    defaultContent: ''
    

    But not allowing search within the mjoin columns reduces the table's functionality greatly.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Is there a native workaround that would allow them to be searched?

    It would need a VIEW at the server-side which implements the Mjoin operation. The Editor library could then apply a simple SELECT to that and read it as a normal table.

    Unfortunately, I haven't found a way in SQL to perform the Mjoin as would be needed for server-side processing with sorting and filtering. I have managed to do so for CloudTables, but it uses a lot of Postgres specific code.

    Sorry I don't have an out of the box solution for you for this one.

    Regards,
    Allan

Sign In or Register to comment.