Hi.
In the Spreadsheet controller when a user imports a spreadsheet into the controller either by cutting and pasting, or by using the import button, was wondering if there was a best practice way to either get all the values even if the value property is undefined or the cell is blank and does not exist in the array of cells for a given row?
I need to ultimately parse the control for the value (and eventually formulas) then putting them in a string with tab separated cells separated by an end of line character for the rows, then send it to an API where it is ultimately placed in the data base as a clob.
The problem is when I am doing this, in certain cases if the cell is empty then it does not exist in cells array for the given row, so when I get my sample data the cells for the row do not line up with the headers, that is to say the cells are missing. If the cells do exist but the value property does not exist, I usually get a JavaScript undefined value (because the value parameter doesn't exist), and I have to use an OR (||) operator to remove it and replace it with a blank.
The only thing I could think of was to iterate through the spreadsheet grid of the active sheet I am working with like this, using the range....but the user would have to select the range prior to kicking of the parsing job.
When the function is done I should have a string of the results with cells separated by \t and rows ending with \n:
DATA in stringified form: {"data":"ID\tInternational_ID\tLast Name\tFirst Name\tDescription\tAuth Role\tApp Server Type\tImport Type\tTime Zone Code\tApplication Type\t\n101\t\tHall\tJoe\tAssit and Admin\tAdvUser\t\t\t102\tAccounting\t\n102\t\tCallet\tBob\t\tAdmin\t\t\t102\tZooology\t\n103\t\tBaker\tDenny\t\tUser\tTripple Node\t\t109\tEngineering\t\n104\t\tBrewster\tFred\t\tAdvUser\t\t\t102\tProject Tracker\t\n105\t\tTurner\tDenise\t\tExecAdmin\tRegular\t\t115\t\t\n106\t\tZenni\tBee\t\tUser\t\t\t102\tAccounting\t\n107\t\tCook\tCarry\t\tAdvUser\t\t\t102\tEngineering\t\n108\t\tMathews\tHarry\t\tUser\t\tInternational\t102\t\t\n109\t\tDean\tDonny\t\tUser\tRegular\t\t102\tProject Tracker\t\n110\t\tFuller\tJames\t\tAdvUser\tTripple Node\t\t102\tScientific\t\n111\t\tAhrens\tJack\t\tAdmin\tRegular\t\t115\t\t\n112\t\tMikes\tGeorge\t\tUser\tHi Capacity\tLocal\t114\tProject Management\t\n113\t\tJones\tArnie\t\tAdvUser\tRegular\t\t116\t\t\n"}
If I cut and paste the above string into an excel spreadsheet sheet it will show the blank cells..and everything aligns.
If I didn't do this, then some of the cells would not exist, and I would getcells shifting into the wrong columns.
I need to capture even the blank cells and those with value == undefined.
Right now I am scanning the cells using a range for the first cell (probably A1) and also the last one... the user needs to set this before the parsing is done and this is very annoying. Is there an easy way to get the used range of the spreadsheet without the user having to set this?
Here is a code snippet of some test code:
https://dojo.telerik.com/@georgeg@pipkins.com/ELelOXuH/5
1) Import the file using the import file button:
2) Click on the Send Data button but I haven't a clue):
... a popup dialog will appear
....and select the range of the cells to be parsed into tab separated values (right now I'd like to figure out the used area automatically, but I haven't a clue).
3) Click the Submit button.
4) Go to console and look at the data:
... you should be able to grab/copy the first bit of data and paste it into a spreadsheet and get it to align with the columns should be no row shifting.
Then the spreadsheet should look like this:
THE BIG-TICKET ITEM IS: I just want to parse through the cells of the Spreadsheet control once, and without having the user select the range... it would be done automatically. I am just wondering if there isn't an easier, cleaner way to do this? I wish I could send you my test excel spreadsheet it would be easier to constrain what is going on... I sent you a tab separated txt file you should be able to convert that easily to an excel file.
Thanks again for your help and patience!
George
Hi,
I am trying to update kendo ui version from 2022.3 to the latest in our old angularJS application.
I followed instructions to build source code as described here:
https://docs.telerik.com/kendo-ui/intro/installation/ecmascript
I am injecting supported version of jquery, order of injections is ok.. there is something else I can't reach.
However, after injecting kendo.all.js (or kendo.all.min.js) and try to run my application, I always get the error shown down.
Any help or suggestion would be helpful.
Thank you and regards,
Vedad
I am running into an issue with allowing copy/paste of dates into the filter and cell input fields. Currently, the date fields have validation to support MM/dd/yyyy, and users of the app may be trying to copy dates in that are MM/dd/yy. I would expect Kendo to auto format the date to MM/dd/yyyy after the paste happens, or at least allow support for that, but it doesn't seem to happen.
In the cell, when putting in MM/dd/yy, a validation message appears saying the date is invalid, and there doesn't appear to be a way to override that. In the filter, when putting in MM/dd/yy and submitting the filter, it doesn't stick and completely ignores the date put in.
Is there any way with the latest version of Kendo (I am on 16) to allow for different date formats in these fields, or is there the possibility that this is something coming in the future?
I use the upload widget in a long-running web app to allow picture upload.
Over the years, the number and size of pictures have increased.
I compress property in the upload widget would be great, however, short of this, has anyone played around with compressing images in the browser in connection with using the upload widget?
/Morten
{
value: String(result[0][i]["date_description"]),
...CONFIG_LEFT,
borderTop: { color: "#000000", style: "solid", width: 1 },
borderBottom: { color: "#000000", style: "solid", width: 1 },
borderLeft: { color: "#000000", style: "solid", width: 1 },
borderRight: { color: "#000000", style: "solid", width: 1 },
},
Hi!
I initialized a multiselect:
let kendoMultiSelect = $("#multisel").kendoMultiSelect({
dataSource: ['item1'],
value: ['item1'],
autoClose: false
}).data("kendoMultiSelect");
and function of refresh multiselect data:
$.ajax({
url: myUrl,
type: "POST",
data: window.kendo.stringify({ objId: that.objId }),
contentType: "application/json",
cache: false,
async: true,
success: function (response) { //response - array (for example: ['new1', 'new2', ...])
let widget = $("#multisel").getKendoMultiSelect();
widget.dataSource = response;
widget.value = response; //I need all the data to be selected at once
}
});
After success query the multiselect did not update.
When I try to open the multiselect dropdown I get an error: "TypeError: this.dataSource.flatView is not a function"
How can I update the multiselect.
when jquery is 1.X,we can do like this
<script>
$(document).ready(function () {
$("#grid").kendoGrid({
dataSource: dataSource,
columns: [{
field: "ContactName",
title: "Contact Name",
values: getDictName('type')
}, {
field: "ContactTitle",
title: "Contact Title"
}]
});
function getDictName(type){
$.ajax({
url:"demo.action",
success:function(result){
return result;//the result like:[{key:'a',value:'apple'},{key:'o',value:'orange'}]
}});
}
});
</script>
but when we change jquery to 3.X, the function of 'getDictName' is not work,because jquery-3.x is not support for 'async:false', so before the function-getDictName returned the result, the kendoGrid is already performed.
I'm looking into using Spreadsheet to enter data into an underlying database quickly.
Like the table below, where the columns A, B, C and D would be loaded from the database, the columns E and F (Sales and VM) should be editable (from row 2), and the Total column (G) should sum Sales and VM.
A | B | C | D | E | F | G | |
1 | Location | Location group | Country | Manager | Sales | VM | Total |
2 | A | X | 1 | I | 6 | 3 | 9 |
3 | B | X | 1 | I | 2 | 2 | 4 |
4 | C | Y | 1 | II | 3 | 1 | 4 |
5 | D | Y | 2 | II | 4 | 2 | 6 |
6 | Total | 23 |
The underlying database would be updated whenever a cell in either column E or F (Sales or VM) was updated (onChange).
On change I would need to be able to get the value of the column header (row 1 ), and the value in the cell from the updated row in column A.
Is all this possible?
/Morten
I have a kendo UI Jquery list view. It has a search bar that filters the datasource. I want the height to be a maximum of 50vh. My issue is that when I only have 1 item, the height is too large. How do I make it automatically calculate the height? Here is a dojo. To demonstrate, set the max and min to 31 so you only have one item, you will notice that the gray box doesn't shrink to fit the one item. If I remove the height option, it doesn't ever show anything.
https://dojo.telerik.com/@dojolee/ApicowUQ
I'm trying to make a few of our datagrids that end up having way too many columns a bit more manageable for users.
Setting the table to 'scrollable: true' seems like it should fix one issue and allow the datagrid to overflow with scrollbars, so you an scroll the table itself rather than the entire page.
But when I add 'scrollable: true' to our datagrid, I get a very different result...instead of allowing the really wide table to scroll, in collapses all the columns to fit the width of the window. In some ways, this is useful--but not at all what that property is meant to do, is it?
Am I misunderstanding something?