Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8565501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:26:27+00:00 2026-06-11T17:26:27+00:00

I am working a on slickgrid where one cell needs to show a dropdown

  • 0

I am working a on slickgrid where one cell needs to show a dropdown (selectlist) with values coming from a restful service. These values are different for each row.

I should be able to select one value from this list (dropdown) and it should persist the value in the cell.

I would be glad if someone could help with this problem.

this.productColumns = [
            {
                id: 'statusid',
                name: 'Status',
                field: 'statusid',
                width: 65,
                sortable: true
            },
            {
                id: 'grade',
                name: 'Grade',
                field: 'grade',
                width: 80,
                sortable: true
            },
            {
                id: 'position',
                name: 'Position',
                field: 'originalPosition',
                width: 80,
                sortable: true
            },
            {
                id: 'tyresize',
                name: 'Tyre Size',
                field: 'tyreSize',
                editable: true,
                width: 140,
                sortable: true
            },
            {
                id: 'tyredetail',
                name: 'Tyre Detail',
                field: 'tyredetail',
                editable: true,
                width: 125,
                editor: this.selectRangeEditor

            }
   ]

      selectRangeEditor: function (args) {

        var $select = $("");
        var defaultValue = "";
        var scope = this;
        this.init = function () {
            var tyreOptionsList = new TyreOptionsModel(args.item.id);
            tyreOptionsList.deferred.done(function () {
                var opt_values = tyreOptionsList.toJSON();
                var count = 0;
                for (var cnt in opt_values) {
                    if (opt_values.hasOwnProperty(cnt)) {
                        count++;
                    }
                }
                option_str = ""
                var i ;
                for (i = 0; i < count-1; i++) {
                    val = opt_values[i].tyreOptionId;
                    txt = opt_values[i].tyreDetail;
                    option_str += "<OPTION value='" + val + "'>" + txt + "</OPTION>";
                }
                $select = $("<SELECT tabIndex='0' class='editor-select'>" + option_str + "</SELECT>");
                $select.appendTo(args.container);
                $select.focus();
            });
        };

       this.destroy = function () {
          $(args.container).empty();
        };

        this.focus = function () {
          $select.focus();
        };

        this.serializeValue = function () {
          return $select.val();
        };

        this.applyValue = function (item, state) {
          item.attributes[args.column.field] = state;
        };

        this.loadValue = function (item) {
          defaultValue = item.attributes[args.column.field];
            $select.val(defaultValue);
        };

        this.isValueChanged = function () {
           return ($select.val() != defaultValue);
       };

       this.validate = function () {
           return {
               valid: true,
               msg: null
           };
       };

        this.init();
        return $select.val();
      }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:26:28+00:00Added an answer on June 11, 2026 at 5:26 pm

    Did you see my answer to this question ?

    If you are able to get the options from the rest service for each row while generating the page, you can just use my solution at the client side …

    As I understand from you comment, the problem is how to postback the changes made in the grid after the user changed some fields …

    I solved this by adding the following piece of code, notice the JS code for the form submit, handle this incoming data at the server side, to save it using the RESTfull service.

    <div id="myGrid" style="width:90%;height:250px;"></div>
    <form action="" method="POST">
      <input id="save_grid_changes" disabled="disabled" type="submit" value="Save changes to {{obj_type}}(s)">
      <input type="hidden" name="obj_type" value="{{obj_type}}">
      <input type="hidden" name="data" value="">
    
    </form>
    
    <script>
    $(document).ready(function() {
    
        grid = new Slick.Grid($("#myGrid"), griddata, columns, options);
    
        $("form").submit(
          function() {
            // commit the last edit ...
            grid.getEditController().commitCurrentEdit(); 
            grid.resetCurrentCell();
            $("input[name='data']").val( $.toJSON(griddata) );
            // ("input[name='data']").val($.param(data));
        });
      });  
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with Slickgrid and only upper rows are being visible. These upper
Working sample using one Table SELECT t.* FROM ( SELECT TITLE.name, (TITLE.value-TITLE.msp) AS Lower,
I'm working with SlickGrid, binding data directly to the grid from an Ajax call.
Working with MS Access for the first time and coming across a few problems
Working on game where plates will be falling from top to bottom. Some plates
Working on calling a C function from my asm project. I'm trying to push
Working demo CLick $(document).ready(function(e) { $('span#pijlr, span#pijll').show(); $('#gallery').css('overflow','hidden'); $('span#pijlr').click(function(e) { if (!$('#gallcont').is(':animated')) { var
Working with box2d and cocos2d, I've calculated two vectors: one is the vector pointing
Working in Scala-IDE, I have a Java library, in which one of the methods
I just started testing out Slickgrid for a project I'm working on and I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.