Kendoui web checkbox data binding - html

Hi I'm not sure if i'm using the right words in the title, please correct me if not. I've been working for almost a month with kendo ui. It's really good.
Now my problem, i'm working with html, django and kendo. I'm getting information from a url in json format. I'm able to load the information in a Kendo Grid, with a boolean values column and a text column. In the boolean values column i've found a way to turn it into a checkbox input column with a field template and set its checked value according to the data i got from the url. The problem is that I can't manage to bind the checked value to the data in the grid's datasource, so when I click the save button to save the new information I get the same data I got from the url. Does anybody know how to do this or a simpler way to do it instead of mine? Thank you!

There is a code library project which covers almost the same scenario. You could use the same idea to update the underlying model which the Grid uses.
http://www.kendoui.com/code-library/mvc/grid/checkbox-column-and-incell-editing.aspx

Related

Angular how to make reusable buttons

Good afternoon everybody.
Let me better explain the situation.
In a myComp.html I got the instance of some dropdown-buttons from another component <app-myButtonsFromAnotherComponent></app-myButtonsFromAnotherComponent>.
The dropdown-buttons are being displayed correctly BUT when I try to get the script which they are originally connected myButtonsFromAnotherComponent.ts they do not seem to communicate at all with it (I am using a Getter function in the .ts but it doesn't retrieve the datas) and at the same time, because of the instance, I cannot access their values from myComp.html either, I can just display the buttons on the screen and display the values through {{theValueInQuestion}} int their original HTML file.
Can anyone, please, help me to get those values and use them in my script?
PS Why "reusable" in the title? Because in such a way I can keep those buttons in a separate component and let other components grab them without copy and paste a ton of code.
They are two separate components you need a way to communicate between components.
you can look more into :
Localstorage
Output() and EventEmitter
Parent to Child via Input

How to storage data from a html popup?

I created a pop up with html with a list of answer. I need to store the answer selected by the user and then display the result in a dynamic infographic. What's the best way to storage the answer and display them in a dynamic infographic? Thanks
The best way is to get the value from the popup by JavaScript and store it into a variable

Access Form - how do I only display fields and cell values if the cell has data?

Could someone please help me with configuring my access database? I would like to use a combo-box at the top of the form where the user selects from the available work forms (Column 1 in Table) and then it displays who is involved in the form. Currently it displays every field and to reduce to the information displayed I would like it to only display information if the cell has a value in it.
Am I using the wrong tool? Should I be using a Report instead? How's my table data, too much?
Many Thanks
My current form
My wanted result
The way I normally hide empty fields is to change the label for a field to a control and set the control source to the following:
=IIf([FieldName]<>'', "My label:", Null)
Then I set the CanShrink property on both the "label" and the field to Yes.
Finally I make sure the section it's in (typically the detail but you may have reason to use something other) also has CanShrink set to Yes.
When you stack the controls on top of each other in this manner you should get the result as you posted.
Note: this only works for reports or if you print the results of a form. If you do not intend to allow entry of data into the form it would be better served as a report.

JQuery and Perl to display dynamic results on drop down selection

I'm currently using Perl CGI to display some internal billing pages at work. I'm using JQuery as well to add a little 'spunk' to it if you will.
I'm looking to generate/display HTML based on drop down selection by the user. Now, I can handle this part no problem. I'm generating table rows/table data on click based on the selection made by the user.
I want to retrieve and display values stored in the database for the corresponding data im displaying on button click, and without refreshing the page of course.
Can someone point me in the right direction? Thanks in advance.
You'll want to use an AJAX request to get the data. So, for example, if you have a select with class 'ajax' and you want to display data based on the option selected, you can do something like:
$('.ajax').change(function(){
$.get({'url', { value: this.val() }, function(data){
// display the data with a .html() or .append() or something
});
});
Replace 'url' with the url of a page that queries the database using the value that you send it.

How can I make a custom JSON Reply (derived from a QueryReadStore) map to a dijit FilteringSelect?

I have some problems getting the custom formated JSON data into a dijit.form.FilteringSelect. It might be that this is the same for other types of dijit select boxes.
update:
One difference when using a FilteringSelect instead of a ComboBox is that validation errors
ar now shown on the element. All input is returning an "invalid value" tooltip.
Here is some sample JSON wich is returned from a database via PHP converted from
an result array:
{"animals":[
{"gr_id":"1","gr_name":"Dog","gr_description":null},
{"gr_id":"4","gr_name":"Cat","gr_description":null}]}
Here is the HTML code for displaying the combo box and defining the store:
<div dojoType="dojox.data.QueryReadStore" url="getAnimals.php" jsId="animalStore">
</div>
<select dojoType="dijit.form.FilteringSelect" store="animalStore" searchAttr="gr_name">
</select>
The search Attribute is processed correctly and the above response is sent back to the client, but the box remains empty.
I do not know how to map the custom JSON response to the label (value displayed as options and used for search : gr_name) and value (value returned on submit : gr_id) position of the dijit select box (FilteringSelect).
When I have been searching for examples, it always seems to work like magic, but I guess that is because they use a default structure for the json data. I can't even confirm this, because the documentation is a bit scarse on those features.
Just extend the QueryReadStore and change the implementation to match your backend. Have a look at the various stores under dojox/data (http://trac.dojotoolkit.org/browser/tags/release-1.5.0/dojox/data) for examples of how to do this.
It's hard to be more specific without knowing more about your backend. But if you look at the flickr store or any of the other stores which map to pre-existing non-dojo data sources you'll get the idea.
I haven't found the sollution I was looking for, but I have fount a workaround at least.
It seems the JSON needs to be delivered in a specific Format to be processed by a dijit.form.FilteringSelect (or related boxes)
The array needs to be called "items" and the names of the identifier and the label need to be given along with the response JSON:
{identifier: "gr_id",
label: "gr_name",
items: [{"gr_id":"1", "gr_name":"Cat","gr_description":null}]}
Since I was looking for a way to make the server side code independent of the view sollution this is not my favourite sollution...