Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I want to display one window on clicking a row in pivot grid in devexpress dashboards in MVC.

In that window I want to display background data of that grid column.
Please help me.I am new to web development.

What I have tried:

I have assigned Itemclick event for a dashboard devexpress in a view.After I have taken one javascript function and passed that function to the view.

Index.cshtml

HTML
<div>
    @Html.DevExpress().Dashboard(settings =>
{
    settings.Name = "clientDashboardDesigner1";
    settings.WorkingMode = Model;
    settings.Width = Unit.Percentage(100);
    settings.Height = Unit.Percentage(100);
    settings.AllowExportDashboardItems = true;
    settings.IncludeDashboardIdToUrl = true;
    settings.IncludeDashboardStateToUrl = true;
    settings.ClientSideEvents.CustomizeMenuItems = "onCustomizeMenuItems";
    settings.ClientSideEvents.BeforeRender = "onBeforeRender";
    settings.ClientSideEvents.ItemClick = "function(s, e) { onItemClick(s, e, $(this)); }";
}).GetHtml()
</div>


My Scripts.js code

JavaScript
function onItemClick(s, e) {
    var i, l, options = [{
        value: 'first',
        text: 'First'
    }, {
        value: 'second',
        text: 'Second'
    }],
    newWindow = window.open("", null, "height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");
    newWindow.document.write("<" + "My Data" + "/>");// Here I want to pass the background data
//That data comes from Excel sheet
}
Posted
Updated 15-May-17 0:36am
v3

1 solution

JavaScript is used client-side and SQL database is considered server side. In order to retrieve that data you need a server-side language.

I use php (learn here![^])

Now, a second question: if you want to update a page already opened on the client you would use AJAX - which allows you to get data from the server and put it on your page without refreshing the whole page. AJAX is a combination of a javaScript call to a server-side php 'page' that returns the data to the javaScript call that then puts it on the page.

It's actually just plain easier to use HTML/CSS3/PHP to create your page setup directly and include javaScript where needed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900