We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to pass additional information from client-side to server-side?

Platform: ASP.NET MVC |
Control: PivotChart |
Published Date: April 17, 2015 |
Last Revised Date: July 2, 2019

This KB illustrates that how to pass additional information from client-side to server-side.

Solution

You can pass the cube name or any other additional information to the control through custom object. The following code example explains this.

JS

<div>
   <select id="cube">
   <option value="Adventure">Adventure</option>
   <option value="Mined">Mined</option>
   </select>
</div> 
<script type="text/javascript">
    $("#PivotChart").ejPivotChart({ url: "../wcf/OlapChartService.svc" });
    $(function () {
        $("#cube").ejDropDownList({
            fields: { text: "option" },
            width: "100px"
        });
        ddlTarget = $('#cube').data("ejDropDownList");
        ddlTarget.setSelectedText(ddlTarget.items[0].innerHTML);
        $("#cube").ejDropDownList("option", "change", "CubeChange");
    });
    function CubeChange(args) {
        $("#PivotChart").remove();
        var chartpanel = ej.buildTag("div#OlapChart")[0].outerHTML;
        $(chartpanel).appendTo(".control");
        $("#PivotChart").ejPivotChart({
            url: "../wcf/OlapChartService.svc", customObject: { CubeName: args.value }
        });
    }
</script>

MVC

<div>
   <select id="cube">
      <option value="Adventure">Adventure</option>
      <option value="Mined">Mined</option>      
    </select>
</div>
<div class="control">
@Html.EJ().Pivot().PivotChart("PivotChart").Url(Url.Content("~/wcf/OlapChartService.svc"))
</div>
<script>
    $(function () {
        $("#cube").ejDropDownList({
            fields: { text: "option" },
            width: "100px"
        });
        ddlTarget = $('#cube').data("ejDropDownList");
        ddlTarget.setSelectedText(ddlTarget.items[0].innerHTML);
        $("#cube").ejDropDownList("option", "change", "CubeChange");
    });
    function CubeChange(args) {
        $("#PivotChart").remove();
        var chartpanel = ej.buildTag("div#PivotChart")[0].outerHTML;
        $(chartpanel).appendTo(".control");
        $("#PivotChart").ejPivotChart({
            url: "../wcf/OlapChartService.svc", customObject: { CubeName: args.value }
        });
    }
</script>

ASP.NET

<div>
 <select id="cube">
  <option value="Adventure">Adventure</option>
  <option value="Mined">Mined</option>      
 </select>
</div>
<ej:PivotChart ID="PivotChart" runat="server" Url="../wcf/OlapChartService.svc"></ej:PivotChart>
<script>
    $(function () {
        $("#cube").ejDropDownList({
            fields: { text: "option" },
            width: "100px"
        });
        ddlTarget = $('#cube').data("ejDropDownList");
        ddlTarget.setSelectedText(ddlTarget.items[0].innerHTML);
        $("#cube").ejDropDownList("option", "change", "CubeChange");
    });
    function CubeChange(args) {
        $("#PivotChart").remove();
        var chartpanel = ej.buildTag("div#PivotChart")[0].outerHTML;
        $(chartpanel).appendTo(".control");
        $("#PivotChart").ejOlapChart({
            url: "../wcf/OlapChartService.svc", customObject: { CubeName: args.value }
        });
    }
</script>

 

2X faster development

The ultimate ASP.NET MVC UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon