Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Disable Selection appearance checkbox only

    SmartClient Version: v9.0p_2013-11-03/PowerEdition
    Browsers: All

    We are using

    selectionAppearance:"checkbox" in a List grid to generate a checkbox column.

    Upon fetch, we want to disable the checkbox for rows that meet a certain condition and we are doing that by

    dsResponse.data.findAll("isDisabled", true).setProperty("enabled", false);

    Now the above statement is unselecting the checkbox and also disabling the entire record making the data in the record hard to read.

    Is there a way to disable just the check box so that the user can still see the data.

    #2
    Set the ListGrid.canSelectProperty to false on the records.

    Comment


      #3
      Great, that worked. This is what we have done

      dsResponse.data.findAll("isDisabled", "true").setProperty("canSelect", false);

      And we have one more question.

      Now we see some rows with the checkBox and some without the checkbox. At this point if start filtering by typing in the grid header, we notice that the checkbox starts appearing even for the rows in which they were hidden.

      When we override the filterData and do custom filtering we are able to retain the checkbox selections, is there a way to retain the selections while filtering without overriding the filterData function ?

      Comment


        #4
        We're not seeing any similar effect where filtering would interfere with how checkboxes are rendered for Boolean columns, regardless of the use of the "canSelect" property. Let us know if you can produce a standalone test case demonstrating the issue.

        Comment


          #5
          Here is an example, where once you start typing in the any of the filter headers, the checkbox selections are erased if they were selected prior to filtering.

          // disable all continent:"Europe" rows
          countryData.findAll("continent", "Europe").setProperty("canSelect", false);

          isc.ListGrid.create({
          ID: "countryList",
          width:500, height:224, alternateRecordStyles:true,
          data: [
          {
          continent:"Europe",
          countryName:"Italy",
          countryCode:"IT",
          area:301230,
          population:58133509,
          gdp:1698.0,
          independence:new Date(1861,2,17),
          government:"republic",
          government_desc:5,
          capital:"Rome",
          member_g8:true,
          article:"http://en.wikipedia.org/wiki/Italy"
          },
          {
          continent:"Asia",
          countryName:"Russia",
          countryCode:"RS",
          area:17075200,
          population:142893540,
          gdp:1589.0,
          independence:new Date(1991,7,24),
          government:"federation",
          government_desc:3,
          capital:"Moscow",
          member_g8:true,
          article:"http://en.wikipedia.org/wiki/Russia"
          },
          {
          continent:"South America",
          countryName:"Brazil",
          countryCode:"BR",
          area:8511965,
          population:188078227,
          gdp:1556.0,
          independence:new Date(1822,8,7),
          government:"federative republic",
          government_desc:3,
          capital:"Brasilia",
          member_g8:false,
          article:"http://en.wikipedia.org/wiki/Brazil"
          },
          {
          continent:"North America",
          countryName:"Canada",
          countryCode:"CA",
          area:9984670,
          population:33098932,
          gdp:1114.0,
          independence:new Date(1867,6,1),
          government:"constitutional monarchy with parliamentary democracy and federation",
          government_desc:1,
          capital:"Ottawa",
          member_g8:true,
          article:"http://en.wikipedia.org/wiki/Canada"
          },
          {
          continent:"North America",
          countryName:"Mexico",
          countryCode:"MX",
          area:1972550,
          population:107449525,
          gdp:1067.0,
          independence:new Date(1810,8,16),
          government:"federal republic",
          government_desc:2,
          capital:"Mexico (Distrito Federal)",
          member_g8:false,
          article:"http://en.wikipedia.org/wiki/Mexico"
          },
          {
          continent:"Europe",
          countryName:"Spain",
          countryCode:"SP",
          area:504782,
          population:40397842,
          gdp:1029.0,
          independence:new Date(1492,0,1),
          government:"parliamentary monarchy",
          government_desc:4,
          capital:"Madrid",
          member_g8:false,
          article:"http://en.wikipedia.org/wiki/Spain"
          },
          {
          continent:"Asia",
          countryName:"South Korea",
          countryCode:"KS",
          area:98480,
          population:48846823,
          gdp:965.3,
          independence:new Date(1945,7,15),
          government:"republic",
          government_desc:5,
          capital:"Seoul",
          member_g8:false,
          article:"http://en.wikipedia.org/wiki/South_korea"
          },
          {
          continent:"Asia",
          countryName:"Indonesia",
          countryCode:"ID",
          area:1919440,
          population:245452739,
          gdp:865.6,
          independence:new Date(1945,7,17),
          government:"republic",
          government_desc:5,
          capital:"Jakarta",
          member_g8:false,
          article:"http://en.wikipedia.org/wiki/Indonesia"
          }

          ],
          showFilterEditor: true,
          filterOnKeypress:true,
          selectionAppearance:"checkbox",
          fields:[
          {name:"countryName", title:"Country"},
          {name:"capital", title:"Capital"},
          {name:"continent", title:"Continent"}
          ],
          canReorderRecords: true
          })

          Comment


            #6
            The filterEditor is not compatible with static data applied directly to a grid via its data attribute.
            For filtering to work, you'll need a specified dataSource.
            (You can use a client-only dataSource if you have all the data available client-side already)

            Regards
            Isomorphic Software

            Comment

            Working...
            X