DDX Card

 We can create web navigation using DDX:

https://public.domo.com/cards/GZjMy

Navigation code HTML:


<div class="topnav">

  <div class="logo">

 <img src="https://www.firstam.com/assets/lib/core/1.7/img/head-logo.png" /></div>

    <a href="javascript:navigation();">Header</a>


navigation is a function name that should be called in javascript

Header is the new page name

</div>


Create Sub Navigation:

<div class="subnav">
    <button class="subnavbtn" active>Product<i class="fa fa-caret-down"></i></button>
    <div class="subnav-content">
        <a href="javascript:costperProcess();">Electronic</a>
   <a href="javascript:DefectCount();">Food</a>
  
    </div>
  </div>
  

Navigation Code Java Script:

var domo = window.domo;

var datasets = window.datasets;


//Step 1. Select your dataset(s) from the button in the bottom left corner

//Step 2. Query your dataset(s): https://developer.domo.com/docs/dev-studio-references/data-api

var fields = ['state', 'revenue'];

var groupby = ['state'];

var query = `/data/v1/${datasets[0]}?fields=${fields.join()}&groupby=${groupby.join()}`;

domo.get(query).then(handleResult);

//Step 3. Do something with the data from the query result

function handleResult(data){

  console && console.log(data);

}

function navigation()

{

  domo.navigate('page or card link',false)

}

CSS Code for design:

body

{

  background:transparent !important;

}

/* Add a black background color to the top navigation */

.topnav {

  background-color: transparent !important;

  overflow: hidden;

  margin-right:5%;

}

.logo img{float:left;}

/* Style the links inside the navigation bar */

.topnav a {

  float: right;

  display: block;

  color: #5c5c5c;

  text-align: center;

  padding: 14px 16px;

  text-decoration: none;

  font-size: 17px;

  border-bottom: 3px solid transparent;

}


.topnav a:hover {

  border-bottom: 3px solid #a4a4a4;

  font-weight: 700;

}


.topnav a.active {

  border-bottom: 3px solid #194a75;

  font-weight: 700;

}