Filtering in Showmodal

How can I filter the to a particular record when showing the edit form in showmodal?
1 person has
this question
+1
Reply
  • The client library offers method showModal that accepts filter as a parameter. You can implement a business rule that will execute a code similar to the one below. The method will show product with ID = 15 if the code is used with the Northwind database.


    // business rules written in C#
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using MyCompany.Data;
     
    public class Class1 : MyCompany.Data.BusinessRules
    {
    public Class1()
    {
    }
     
    [ControllerAction("Products", "Custom", "ShowArbitraryProduct")]
    public void ShowProduct()
    {
    Result.ExecuteOnClient(String.Format(
    "var dv=Web.DataView.showModal(null,'Products','editForm1','Edit','editForm1', this.get_baseUrl(), this.get_servicePath(), [{{Name:'ProductID', Value: {0}}}]);" +
    "dv._parentDataViewId=this.get_id();" +
    "dv._lastViewId=this.get_viewId();",
    15));
    }
    }
     
    // action definition in the data controller
     
    <action id="a7" commandName="Custom" commandArgument="ShowArbitraryProduct"
    headerText="Show Product" description="Show product #15 in a modal view."/>
     
     


    We will consider implementing a .NET wrapper method call in the future.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated