get Checked row and pass id

get Checked row and pass id

TonicServerTonicServer Posts: 8Questions: 2Answers: 0

Hello i use dataTable in my site ... when i have more than 1 page , form just pass active page check row.
i use this jquery for get check row id and pass with form
$("#BtnClick").click(function () {

       $.each(
            $("input[type=checkbox]"),
            function() {
                var catName = $(this).attr('name');
                datasets[catName] = {
                    label: catName,
                    data: []
                };
            });

       $.each(
            $("input[type=checkbox]:checked"),
            function () {
                var catName = $(this).attr('name');
                datasets[catName].data.push($(this).val());
            });
        var data ={};
        $.each(
            datasets,
            function (item, dt) {
                var name = item;
                var value = dt['data'].join(",");
                data[name] = value;
            }
        );

        $("#hiddenForm").autofill(data);
        $("#hiddenForm").submit();
    });

and this is my hidden form

                            <button id="BtnClick" class="btn btn-sm btn-success" type="submit">
                                submit
                            </button>
                            @using (@Html.BeginForm("LineRegimeSave", "DietTherapy", FormMethod.Post, new { id = "hiddenForm" }))
                            {
                                <input type="hidden" name="BreakFast" value="" />
                                <input type="hidden" name="Snake1" value="" />
                                <input type="hidden" name="Lunch" value="" />
                                <input type="hidden" name="Snake2" value="" />
                                <input type="hidden" name="Snake3" value="" />
                                <input type="hidden" name="Dinner" value="" />
                                <input type="hidden" name="Snake4" value="" />
                                <input type="hidden" name="AdviseText" value="@TempData["Advise"].ToString()" />
                                <input type="hidden" name="docFooterId" value="@TempData["footerId"].ToString()" />
                            }

may you help me how can i get all page checked row ?

Answers

This discussion has been closed.