Code Monkey home page Code Monkey logo

Comments (9)

estruyf avatar estruyf commented on August 28, 2024 1

@ymihir did you update the targetProperty to the property in your web part. This was incorrectly documented and updated it: https://sharepoint.github.io/sp-dev-fx-property-controls/controls/PropertyFieldListPicker/

So lists must be the same on line 1 ('lists') and 3 (this.properties.lists):

PropertyFieldListPicker('lists', {
  label: 'Select a list',
  selectedList: this.properties.lists,
  includeHidden: false,
  orderBy: PropertyFieldListPickerOrderBy.Title,
  disabled: false,
  onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
  properties: this.properties,
  context: this.context,
  onGetErrorMessage: null,
  deferredValidationTime: 0,
  key: 'listPickerFieldId'
})

If you copied it from the documentation, you would probably have singleList which is not correct.

from sp-dev-fx-controls-react.

ymihir avatar ymihir commented on August 28, 2024 1

Yes I have sorted out that issue. Thanks for the documentation update.

from sp-dev-fx-controls-react.

estruyf avatar estruyf commented on August 28, 2024

Hi @ymihir have you already tried specifying the viewFields property? Here is an example:

const viewFields: IViewField[] = [
      {
        name: 'ListItemAllFields.Id',
        displayName: 'ID',
        maxWidth: 40,
        sorting: true
      },
      {
        name: 'ListItemAllFields.Underscore_Field',
        displayName: "Underscore_Field",
        sorting: true
      },
      {
        name: 'Name',
        linkPropertyName: 'ServerRelativeUrl',
        sorting: true
      },
      {
        name: 'ServerRelativeUrl',
        displayName: 'Path',
        render: (item: any) => {
          return <a href={item['ServerRelativeUrl']}>Link</a>;
        }
      },
      {
        name: 'Title'
      }
    ];

from sp-dev-fx-controls-react.

ymihir avatar ymihir commented on August 28, 2024

@estruyf but as per the documentation viewFields is optional right! I need to pass the structure compulsory?
I am implementing this with PropertyFieldListPicker. When I select any list and if i reload the page, earlier selection is not preserving. Dropdown value coming as blank. Any idea about this issue?

from sp-dev-fx-controls-react.

estruyf avatar estruyf commented on August 28, 2024

Yes, it is, but in combination with the iconFieldName it will only show the icon. If you would remove the iconFieldName, the control itself will define the fields to show.

from sp-dev-fx-controls-react.

ymihir avatar ymihir commented on August 28, 2024

Yes, Perfect Once i remove the iconFieldName it is showing as below with raw data. Any idea with second issue where dropdown value is not preserving as showing in second screenshot.
spfx-reactcontrols_render_fine

spfx-reactcontrols_render_nolist

from sp-dev-fx-controls-react.

estruyf avatar estruyf commented on August 28, 2024

That could be a bug in the Office UI dropdown control. Which version of the SPFx are you using? If possible, can you also check the installed version of office-ui-fabric-react?

from sp-dev-fx-controls-react.

ymihir avatar ymihir commented on August 28, 2024

i am having office-ui-fabric-react version as 5.6.0

from sp-dev-fx-controls-react.

jburagev avatar jburagev commented on August 28, 2024

Hello,

I have similar issue where I defined the ViewFields:

export const viewFields : IViewField []= [{
name: "Car",
displayName: "Car",
//linkPropertyName: "c",
isResizable: true,
sorting: true,
minWidth: 0,
maxWidth: 150,
render: (item:any) =>

{item.Car['Car']}

},{
name: "DistanceKm",
displayName: "Distance",
isResizable: true,
sorting: true,
minWidth: 0,
maxWidth: 100
},];

But the Car field is not rendered and I get error. Each other field is rendered as it should. I tried every combinations like item.Car.Car, item['Car'].Car etc. I receive the items from Sharepoint as following:

image

The error that i got is:

image

Please help.

Thanks.

from sp-dev-fx-controls-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.