How can i send a data via post call in combo box.
help will be appreciated.
Thanks.
Hello Pawan,
Which platform are you using? eg. ASP.Net or Ignite UI (jquery controls)
Hello Michael,
First of all thank you for replying.
actually i am using angularJS so if possible can u give me the suggestion related to that platform.
if not then i will prefer with Jquery control.
Thank You.
Hi Pawan,
Since you are using AngularJS, you can use their Http service to post data to your server. You can find documentation on using this service from Angular's documentation here:
https://docs.angularjs.org/api/ng/service/$http* Please note this site is not owned or maintained by Infragistics.
If you are using our igCombo, you already have jQuery's ajax() and post() methods available. You can find jQuery's documentation for these methods here:
http://api.jquery.com/jQuery.ajax/http://api.jquery.com/jQuery.post/* Please note this site is not owned or maintained by Infragistics.
If you have any further questions or concerns with this, please let me know.
Can u please provide me demo regarding the POST call in igcombo using angular/jquery.
It will be great if u provide me some kind of demo.
When would you be triggering the POST action? Would this be as soon as you change the value of the igCombo or would you be executing this on some other trigger such as a button click? What sort of data are you looking to send over the POST call?
Hello Jason,
Actually not on any trigger i want to send POST call for binding data on igcombo.
I am using DataSource property and in that i am using my api url.
but i am unable to send the data to server via a POST call, is there any property avialable to send the POST call.
Demo will be appreciated.
Thank you.
The igCombo is really designed for a POST operation and modifying it to do so and send data would require jumping through a few hoops. Honestly, the best approach would be to use the standard Angular httpService to trigger the post like Mike suggested earlier:
https://docs.angularjs.org/api/ng/service/$http
Here is an example of using the $http.post: http://jsfiddle.net/bkUEu/458/ Note that this is a standard approach and not anything specific to Infragistics. In the success function you could take the data that is returned and apply it to a variable in your controller for the combo. You can then bind the combo to that variable and the combo then will be able to pick up on whenever that collection is changed. For an example of binding the igCombo to a variable from an Angular controller please see the following example:
http://igniteui.github.io/igniteui-angular/samples/igCombo.html
If you have any questions about the details of this approach please let me know.
Posting data on the initial bind of the igCombo was not in the design requirements for the control. I am sorry you are not satisfied, though if you would like to have this behavior considered for future implementation you may submit it to the Infragistics Product Idea page.
Thank's Jason for providing demo.
Though i am not satisfied with this functionality of ig-combo.
Can i know the reason that why i cannot post the data with igcombo, and if i can then what are the steps to do that.
Thank you,
Pawan Ingale.
It is important to note that the igCombo itself is just going to try to send a standard GET request to whatever URL you provide to the dataSource setting. If you want to send data over in the request then you are better off using the standard $.ajax call for jQuery. Then, in the success function you would set the dataSource of igComob instead of setting it initially to your URL.
I have attached a small sample with this update. In the sample I'm using Mockjax to set up a fake webservice that simply returns different arrays. In my ajax call you can see I'm passing over some data and in the success function I call $('combo selector').igCombo('option', 'dataSource', data) which sets the data as I need on the igCombo. In theory you could even take this one step further if needed and instantiate the combo completely in the success handler, but this may give your page the appearance of the combo suddenly appearing from nowhere if there is any latency on your service.
Please let me know if you have any questions or concerns about this implementation.
sorry that you are not able to understand what i am trying to explain you.
but in simple language i am using ignite's Datasource property to access my rest service with that i want pass one object with that just like jquery's data property.
So if you now got understood than please help me out by giving a simple demo using ignite's Datasource property sending one object with it.
I've reread this thread and there are a few things I'm unclear on. What sort of data are you posting to the server and how does this influence the combo's behavior? What sort of action causes that post. How are you setting up the combo to bind to the data that comes back and what have you tried so far?
The example of the igCombo on the Ignite UI Angular github site provides the general approach for binding the igCombo to data provided through the controller. If you wanted to use a post to send and retrieve data from your server then you would use the standard Angular approach for doing that; nothing special needs to be done with the combo. Once you have the data back from the server in your success handler you would pass that data to the variable in the controller that the combo is bound to. Is there any issue you are having with that approach? What sort of behavior are you seeing?