Telerik Forums
Kendo UI for jQuery Forum
2 answers
301 views

Hi

I would like to send a value (userid) with the read command of dataSource. I've done several tests but I can't catch the posted value in PHP.

Working$userid = $_POST["userid"] = 1234 on server side):

            $.ajax({
                type: 'POST',
                url: 'readparameter.php',
                data: {userid: "1234"},
                async: true,
                dataType: 'json',
                success: function(result) {      
                   console.log (result);
                }
            });


Not working ( $userid $_POST["userid"] = NULL on server side):

var mySource = new kendo.data.DataSource({
            dataType: 'json',
            transport: {
                read: function (options) {
                    $.ajax({
                        type: "POST",
                        dataType: 'json',
                        async: true,
                        data: {userid: "1234"},
                        url: "readparameter.php",
                        success: function (result) {
                            console.log (result);
                        }
                    });
                }
            }
        });

My assumption is that the posted userid never reaches the server using dataSource. I'm trying since a lot of time and tried several ways like also Json.stringify etc. What am I doing wrong or is it just not possible to pass a value with dataSource?

Tayger
Top achievements
Rank 1
Iron
Iron
 updated answer on 23 Jan 2022
0 answers
165 views

Hi,

I have one requirement from our manager who wants to display some data as part of bubble chart like pie chart. (basically he wants to see something in bubble chart, but then split bubble value based on proportion (for example: bubble is total amount of resources used, but then its split based on how much of each resource participated in this).

Is it possible to achieve this somehow?

Thanks a lot!

Regards,

Vedad

Vedad
Top achievements
Rank 3
Bronze
Bronze
Iron
 asked on 21 Jan 2022
1 answer
298 views

I know how to do this, but I was wondering if there is a simpler way that I do not know. The solution I found seems a bit complicated for something that seemed simple at first.

 

I have a non-editable grid. For each item in Y, I have multiple cells in X displaying a counted number. I don't care about zeroes, so as to not draw attention to them I output a number only if it's not zero. To do that, the values I feed in my datasource needs to be in string format.

When I export this grid to Excel, by default all cells are of the "General" type. If I manually try to switch the cells to the "Number" type, it doesn't work right because the data is still a string.

I want my Excel export to have it's cells already in the "Number" type with it's data in the right format.

 

What I had to to is this :

- Change the values in my datasource to numbers, but now my grid displays zeroes.

- Create a template for my cells to control when to display numbers or not.

- Add a excelExport event handler to set my cells' format. The resulting cell type is always tagged as "Custom". Isn't there a way select one of the defaut Excel cell types? Is seems to work, but it feels weird to have to create custom formats to replicate default ones.

 

Did I miss something that would have made my life easier?

 

Thank you

 

 

Nikolay
Telerik team
 answered on 21 Jan 2022
1 answer
269 views

Dears,

I need help in inline edit grid , i want way in that if user create row first time it add row (e.g item name, quantity), if user add same item again in the grid and that item exists in the grid update the quantity of first record and remove the new record.

 

how can i do that?

 

Thanks

Nikolay
Telerik team
 answered on 21 Jan 2022
1 answer
85 views

Hi,

I'm sure this is a stupid question however I've not seen an example of how to do this.   I need to output just a simple status as a string in the popup editor external template when editing an appointment on the scheduler.    It does not need edited - it is there just to show the user if they are approved to request that appointment or not.   

I have the status value in my ViewModel and I need to display it on the appointment double click.  I've tried @Model.status but need something equivalent to @Html.Kendo().TextboxFor(m=>m.status).   By doing it this way the string shows but it is in a textbox of course.....I need to make it appear as just a string of text similar to a label.

Thanks for any help!

Shawn
Top achievements
Rank 1
Iron
 answered on 19 Jan 2022
1 answer
493 views

Hi Telerik Team,

I'm testing with ~2k images with FileManager. Setted pageable and pageSize to File Manager's data source, grid and list view config. In grid view mode, pagination working well, but in listview mode, there're no pagination bar shown. Tried with outside pager but it not help.

Please advise.

Martin
Telerik team
 answered on 19 Jan 2022
0 answers
216 views

Hello,

I'm reading some datasets from a database and use the values to fill a grid - and on the other hand fill a small form.

The form contains among others a rangeslider.  After a quick Google search I was pointed to the Telerik Forums.

So now I do it with the following code-section

   var rangeslider = $("#rangeslider").data("kendoRangeSlider");
   var rangeValues = [currentDataItem.MinPosition, currentDataItem.MaxPosition];
   rangeslider.setOptions({
      min: 0,
      max: currentDataItem.MaxPositionMeter,
      smallStep: 1,
      largeStep: 10,
      tickPlacement: "both"
   });
   rangeslider.value(rangeValues);

My problem is :
exemplary section of the data-grid
0, 704, 800
48, 752, 800
96, 800, 800

the first 2 numbers "serve" value-array and 800 as the max-parameter.
First 2 lines get displayed correctly, but the 3rd row behaves wierdly. The selection start-marker is displayed correctly, but whatever data-row was displayed at first, determines where the selection-end marker of the rangeslider is drawn, so it doesn't "move" - and the selection-range is displayed with correct length - but as the selection-end marker is not at the correct position the selection suddenly goes beyond  the selection-start marker.

Is there anything I can do to prevent this weird behavior? Is it a problem when the value for selection-end is equal to max?

For reference I include a screenshot of the rangeslider drawn when going from data-row 2 to row 3

The min-value is always 0 for all 3 data-rows

Sven
Top achievements
Rank 1
Iron
Iron
Iron
 updated question on 18 Jan 2022
1 answer
321 views

I'm trying to group my category axis by year and quarter but am struggling to find a suitable solution. I've found this was requested in the following link some time ago (2013). Has there been any sort of implementation to group on quarters?

https://www.telerik.com/forums/please-consider-supporting-quarters-in-date-series-just-like-weeks

Thanks
Ben

Nikolay
Telerik team
 answered on 18 Jan 2022
1 answer
184 views

Hi i got some trouble for searching in my search bar where kendo grid search function work

This is kendo grid search bar where it work in searching

enter image description here

Input search is not working when searching

enter image description here

This is input search code that i link to kendogrid

 

$("#search-user-name").on("keyup change", function() {
  var grid = $("#user-list").data("kendoGrid");
  grid.dataSource.filter({
    logic: 'contains',
    filters: [{
      field: "username",
      operator: "contains",
      value: $(this).val()
    }]
  });
});
<input class="search-input form-control" placeholder="Name" type="text" name="User Name" id="search-user-name">
Nikolay
Telerik team
 answered on 18 Jan 2022
1 answer
803 views

Hi, I'm trying to scroll my grid to a specific cell (td) in a specific row. Currently I'm able to navigate to X row in a paginable grid and I can get the information of that row but I'm wondering if there is something similar to what I'm using to scroll to row. This is the code I have for now:

 Select row with ID = <input id="numeric" /> (1-78)
    <button id="searchBtn" class="k-button">Go</button>
    <div id="grid"></div>
    <script>
      function selectGridRow(searchedId, grid, idField){
        var dataSource = grid.dataSource;
        var filters = dataSource.filter() || {};
        var sort = dataSource.sort() || {};
        var models = dataSource.data();
        // We are using a Query object to get a sorted and filtered representation of the data, without paging applied, so we can search for the row on all pages
        var query = new kendo.data.Query(models);
        var rowNum = 0;
        var modelToSelect = null;

        models = query.filter(filters).sort(sort).data;

        // Now that we have an accurate representation of data, let's get the item position
        for (var i = 0; i < models.length; ++i) {
          var model = models[i];
          if (model[idField] == searchedId) {
            modelToSelect = model;
            rowNum = i;
            break;
          }
        }

        // If you have persistSelection = true and want to clear all existing selections first, uncomment the next line
        // grid._selectedIds = {};

        // Now go to the page holding the record and select the row
        var currentPageSize = grid.dataSource.pageSize();
        var pageWithRow = parseInt((rowNum / currentPageSize)) + 1; // pages are one-based
        grid.dataSource.page(pageWithRow);

        var row = grid.element.find("tr[data-uid='" + modelToSelect.uid + "']");
        if (row.length > 0) {
          grid.select(row);

          // Scroll to the item to ensure it is visible
          grid.content.scrollTop(grid.select().position().top);
        }
      }

      $(document).ready(function () {

        $("#searchBtn").click(function(){
          var grid = $("#grid").data("kendoGrid");
          var searchedId = $("#numeric").data("kendoNumericTextBox").value();

          selectGridRow(searchedId, grid, "ProductID");
        });

        $("#numeric").kendoNumericTextBox({
          min: 1,
          max: 78,
          format: "n0"
        });

        $("#grid").kendoGrid({
          dataSource: {
            type: "odata",
            transport: {
              read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Products"
            },
            schema: {
              model: {
                id: "ProductID",
                fields: {
                  ProductID: { type: "number" },
                  UnitPrice: { type: "number" },
                  UnitsInStock: { type: "number" }
                }
              }
            },
            pageSize: 10
          },
          height: 350,
          sortable: true,
          filterable: true,
          selectable: "row",
          pageable: {
            refresh: true,
            pageSizes: true
          },
          columns: [
            {
              field: "ProductID",
              title: "ID",
              width: 100
            },{
              field: "ProductName",
              title: "Product Name",
              width: 180
            }, {
              field: "UnitPrice",
              title: "Unit Price"
            }, {
              field: "UnitsInStock",
              title: "Units in Stock"
            }, {
              field: "Discontinued",
              width: 150
            }]
        });
      });
    </script>

 

And here is the DOJO: https://dojo.telerik.com/OBaYiguF

 

Right now the code is navigating to any row in the grid (that's okay) the next thing I want to do is once that I'm in the selected row then select a specific cell (for example "Units in stock")

Georgi Denchev
Telerik team
 answered on 17 Jan 2022
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?