How to select within editor

How to select within editor

rangaranga Posts: 31Questions: 12Answers: 2

Hi all. following c# editor initialization returns all the rows . how can i select specific set based on an id number. may be like

.field( new field("id"). .Options("Test", "Name", "Name", q => q
.Where("IsDefault", false)
.Order("Sequence") ?????

sorry i coudnt find such in editor examples. any help would be really appreciated. Thank you.

`public JsonResult aaa()
{

        POPM_Trn_IOU asss = new POPM_Trn_IOU();

        var request = System.Web.HttpContext.Current.Request.Form;
        var settings = Properties.Settings.Default;

        string pkey;
        using (var dbs = new DataTables.Database(settings.DbType, settings.DbConnection))
        {
            var response = new Editor(dbs, "P_Items", pkey = "IItem_ID")
                .Model<P_Trn_IOU_Items>()

                 .Field(new Field("I_ID")

    )


                 .Field(new Field("P_Item_ItemName")


                 )
                   .Field(new Field("P_Item_Topic1")


                 )
                .Field(new Field("P_Item_Topic2")

                )
                 .Field(new Field("P_Item_Topic3")

                )



                  .Field(new Field("P_ItemNumber")


                 )

                .Process(request)
                .Data();

            string dd = response.ToString();

            return Json(response, JsonRequestBehavior.AllowGet);
        }

    }

`

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    If I understand correctly, you want the options for each row to be different based on the id. Is that correct? If so, you'd need to use dependent() and have an Ajax script which will respond with the options required when each edit starts.

    Allan

  • rangaranga Posts: 31Questions: 12Answers: 2
    edited August 2018

    @Allen Thanks for the response .
    What is my trouble here is very basic. when i initialize editor model for a table with existing records, datatable is populated with all the data in the table cos there is no selection. i simply need to pass and select data based on a condition. like select from where id = currentID, . its mainly with the datatables not with the editor. but datatable is getting data from the editor fields. im expecting this on server side. where in a controller in asp.net.

    Dependent is for row wise operations right ? where i want to select entire record set on a condition. just like an sql select query. any example would be great. i got the editor example project if there is an example.

  • rangaranga Posts: 31Questions: 12Answers: 2
    Answer ✓
  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Perfect - thanks for posting back!

    Allan

This discussion has been closed.