Giter VIP home page Giter VIP logo

Comments (8)

RohitSharma2k122 avatar RohitSharma2k122 commented on June 1, 2024 1

Thanks so much @mikhail-vl.

Its works for me.

from volkovlabs-form-panel.

mikhail-vl avatar mikhail-vl commented on June 1, 2024

@RohitSharma2k122 Thank you for your interested in the Data Manipulation plugin.

Plugin is doing POST requests with parameters in the body. Does .netcore support POST with body? I am not familiar with it.
We have a Node.js example for reference: https://github.com/VolkovLabs/volkovlabs-form-panel/blob/main/server-pg/server.ts

Please let me know.

from volkovlabs-form-panel.

RohitSharma2k122 avatar RohitSharma2k122 commented on June 1, 2024

HI @mikhail-vl

This is my Json data, Now i am passing on POST requests with parameters in the body. Can you help me where its missing plz suggest.

{
"id": 4,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"type": "volkovlabs-form-panel",
"title": "Feedback",
"datasource": {
"uid": "grafana",
"type": "grafana"
},
"options": {
"initial": {
"method": "-",
"contentType": "application/json",
"code": "console.log(options, data, response, elements, locationService, templateService)",
"highlight": false,
"highlightColor": "red"
},
"update": {
"method": "POST",
"contentType": "application/json",
"code": "console.log(options, data, response, elements, locationService, templateService)",
"confirm": false,
"body": [
{
"name": "ID",
"value": "$1"
},
{
"name": "Name",
"value": "$2"
},
{
"name": "Email",
"value": "$3"
}
],
"url": "http://localhost:61761/Test"
},
"layout": {
"variant": "single"
},
"buttonGroup": {
"orientation": "center",
"size": "md"
},
"submit": {
"variant": "primary",
"foregroundColor": "text",
"backgroundColor": "semi-dark-green",
"icon": "anchor",
"text": "Submit"
},
"reset": {
"variant": "destructive",
"foregroundColor": "yellow",
"backgroundColor": "purple",
"icon": "process",
"text": "Reset"
},
"elements": [
{
"id": "ID",
"labelWidth": 10,
"section": "",
"title": "ID",
"tooltip": "",
"type": "string",
"value": "1"
},
{
"id": "Name",
"labelWidth": 10,
"section": "",
"title": "Name",
"tooltip": "",
"type": "string",
"value": "Rohit"
},
{
"id": "Email",
"labelWidth": 10,
"section": "",
"title": "Email",
"tooltip": "",
"type": "string",
"value": "[email protected]"
}
]
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "datasource",
"uid": "grafana"
}
}
]
}

from volkovlabs-form-panel.

mikhail-vl avatar mikhail-vl commented on June 1, 2024

@RohitSharma2k122 I see that your URL is "url": "http://localhost:61761/api/Test".

Are you running Grafana and .netcore on your localhost? This is the URL your browsers will make a POST call, so you should be able to reach it.

What do you see in the Browser's Console -> Network?

from volkovlabs-form-panel.

RohitSharma2k122 avatar RohitSharma2k122 commented on June 1, 2024

Thanks @mikhail-vl for helps. Appreciate your support.

Am able to Post the data back to data source.
Even am able to clear value of the form data after the POST request, while adding below line of code inside Custom Code.
elements.map((element) => { element.value = '' });

But not able to clear the value of the form on click of reset button. Can you do the needfull here.

Thanks in adavance

from volkovlabs-form-panel.

mikhail-vl avatar mikhail-vl commented on June 1, 2024

@RohitSharma2k122 The Reset button perform Initial Request and runs custom code.
If you don't use Initial Request you can clear out all the fields using custom code:

elements.map((element) => {element.value = ''});

Or any particular fields if required

elements.map((element) => {
   if (element.id === 'name') {
     element.value = '';
   };
})

Please let me know if there is anything else.

from volkovlabs-form-panel.

mikhail-vl avatar mikhail-vl commented on June 1, 2024

@RohitSharma2k122 Thank you, let us know if there is anything else.

from volkovlabs-form-panel.

RohitSharma2k122 avatar RohitSharma2k122 commented on June 1, 2024

Thanks @mikhail-vl !

All works!

from volkovlabs-form-panel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.