We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

grid How do I get all the values?

Thread ID:

Created:

Updated:

Platform:

Replies:

132048 Aug 9,2017 06:36 PM UTC Aug 28,2017 04:25 AM UTC JavaScript 4
loading
Tags: ejGrid
serdar
Asked On August 9, 2017 06:38 PM UTC

hello How do I get all the values?ü
I found this code but I did not get the values
thank you

$("#GridProductStores").ejGrid("getRows");



$("#GridProductPrices").ejGrid({
        dataSource: data,
        allowPaging: true,
        allowSorting: true, 
        pageSettings: { pageSize: 8 },
        allowFiltering: true,
        height: "150px",
        isResponsive: true,
        isResponsive: true,

        editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, },
        toolbarSettings: { showToolbar: true, toolbarItems: [ej.Grid.ToolBarItems.Add, ej.Grid.ToolBarItems.Edit, ej.Grid.ToolBarItems.Delete, ej.Grid.ToolBarItems.Update, ej.Grid.ToolBarItems.Cancel] },

        contextMenuSettings: {
            enableContextMenu: true, contextMenuItems: [],
            customContextMenuItems: [
                { id: 'delete', text: "Seçili Hareketi Sil" },
            ]
        },
        columns: [
                { field: "ProductID", visible: false },
                { field: "PriceID", visible: false },
                { field: "Name", headerText: "Fiyat Adı", width: 80, priority: 2 },
                { field: "Price", headerText: "Fiyat", width: 30, priority: 2 },
                { field: "Currency", headerText: "Döviz", width: 30, priority: 2 },
        ]
    });

ajax

  var prices = $("#GridProductPrices").ejGrid("getRows");

$.ajax({
            url: '/Product/AddProduct',
            data: JSON.stringify({
                prices : prices 
            }),
            async: false,
            cache: false,
            dataType: "json",
            type: "POST",
            contentType: "application/json; charset=utf-8",
            complete: function () {
            },
            success: function (result) {

            },
            error: function (e) {

            }
        });




Bruce Van Horn
Replied On August 9, 2017 09:59 PM UTC

You need a reference to the grid object, then take a look at the model object - everything will be in there:

var gridObj = $("#Grid").ejGrid("instance");

gridObj.model.dataSource should have the data source in it and from there you can just loop through that and access the fields on the objects to get the values.


Thavasianand Sankaranarayanan [Syncfusion]
Replied On August 10, 2017 05:16 PM UTC

Hi Serdar, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we suspect that you want to get the record details from Grid. By using the getRows() method we can get the tr elements of current page in Grid. So, if you want to get all the record details from Grid, then we suggest you to follow the previous response updated by Bruce Van Horn. 

You can get the record detail other than Grid’s model DataSource.  

  1. Using the getSelectedRecords() method, we can get the selected record details from Grid.
  2. Using the getCurrentViewData() method, we can get the current page record details from Grid.
  3. Using the getFilteredRecords() method, we can get the filtered records detail from Grid.

Note: If you not satisfied with the solution then share the details of exact scenario that you expecting for record details. 

Refer the help documentation. 




If we misunderstood your query then please get back to us. 

Regards, 
Thavasianand S. 


serdar
Replied On August 26, 2017 07:11 AM UTC

yes its working 

thank you


Thavasianand Sankaranarayanan [Syncfusion]
Replied On August 28, 2017 04:25 AM UTC

Hi Serdar, 
 
We are happy that the problem has been solved at your end. 
 
Please get back to us if you need any further assistance.  
 
Regards, 
Thavasianand S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;