Translating server side php code to .net for checkboxes in columns example

Translating server side php code to .net for checkboxes in columns example

dhutton@creativeone.comdhutton@creativeone.com Posts: 59Questions: 15Answers: 0

I'm following this tutorial and need help translating the server side code from php to .net (I'm in .net core 2.1) - https://editor.datatables.net/examples/api/checkbox.html

Right now I have the checkbox working but after checking it I'm seeing the text field edit come up (yellow background, 1 shows up). I'm guessing this missing server side code with setformatter I haven't been able to translate is to blame for this oddity.

TIA!

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @dhutton@creativeone.com ,

    As you can see in that example, if configured correctly it should be working fine, so we'll need to see your code to see what's wrong with yours. Could you post the client-side and server-side scripts here, please.

    Cheers,

    Colin

  • dhutton@creativeone.comdhutton@creativeone.com Posts: 59Questions: 15Answers: 0

    I'll re-phrase - if I were to take the php server side code given in the example and translate that over to .net core, how would that look?

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @dhutton@creativeone.com ,

    The client side code will be the same. There's example of the formatters for the server-side on the .Net manual pages - see here. I suspect it'll just be

    SetFormatter((val, data) => (string)val == "" ? 0 : 1)
    

    In the .NET download page, there'll be similar examples of this. Hope that helps, shout if not,

    Cheers,

    Colin

This discussion has been closed.