Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

209
Vistas
Use global variable in json - javascript - aggrid

I'm trying write a function which opens new tab refering to a linked source.

For that I need to send a payload with the id and other parameter which I already have in my grid table (field: "globalId" and field: "id").

I tried to execute the command to get the value, but I'm not able to use variables in the payload load as i get "{x}" as a result, is there any way to retrieve this from the already generated grid table?.

This is the part of the code I'm having issues with:

var x = formData.get().root.id;
  
 function openApplication() {
    var postData = {
            "action": "openApplication",
            "payload": {
                        "id": "x",
                        "caseId": "a75659c-36f315678299515",
                        "name": "test"
}
};

Here is the full code (which has the columns that need to retrieve the values from):

<script type="text/javascript" charset="utf-8">

 function DataFromAPI()
        {
    var url=basepath + '/rest?limit=20&offset=0&q=type:CAS+state:open+ModelId:eq:jlbc421f00f2f+name:eq:'+formData.get().root.name;
    httpClient.get(url, function (result) {
        gridOptions.api.setRowData(result);
      tempData.set('AsearchResult'.result);
      });
        }
   var columnDefs = [
            { 
          field: "Date", 
          headerName : "Date",  
          editable: false,
          resizable: true,
            }
        { 
          field: "id", 
          headerName : "",  
          resizable: true

        },
        { 
          field: "globalId", 
          headerName : "",  
          resizable: true

        }
        ];

  function getData() {
        const rowData1 = [];
        return rowData1;
        }
  
  // let the grid know which columns and what data to use
    const gridOptions = {
                columnDefs: columnDefs,
                onRowClicked: event => openApplication(),
                  defaultColDef: {
                    editable: true,
                    rowSelection: 'single',

                    filter: true,
                    sortable: true,
                    flex: 1,
                    minWidth: 100,
                    animateRows: true,
                    }
                };
    const eGridDiv = document.querySelector('#MeetingGrid');
    new agGrid.Grid(eGridDiv, gridOptions);
  DataFromAPI();
  
var x = formData.get().root.id;
     function openApplication() {
        var postData = {
                "action": "openApplication",
                "payload": {
                            "id": "x",
                            "caseId": "a75659c-36f315678299515",
                            "name": "test"
    }
    };

  
</script>
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda