update podio category to no value - podio

I have an app that has several fields in it and some of them have a category item that only has one value (Yes) we use that field to keep track of whether or not a client is using that feature in our software or not. We have it so that when the feature is turned on the value in selected in podio and the 'Yes' value is then highligted (or selected). However, I am having difficulty setting the field to no value when they are no longer wanting to use that feature. I have tried values '', false, No value, No, null. All of these return an error from podio telling me that they are not valid values. All I want to do is unselect a category option using the API.
PodioItem::update((int) $user->getPodioProject(), array('fields' => array(
"field-name" => '')));
this is what I get in response from podio
[error_description] => Invalid value "" (string): Not a valid option
[error] => invalid_value
Thanks
Jamie

Category field value is array and not empty string, please try:
PodioItem::update((int) $user->getPodioProject(), array('fields' => array(
"field-name" => array())));

Open an item in that app, right click on the 'No' option then click 'Inspect Element'. You will find the HTML tag of that option, look at the value inside of data-id="", this is the value you are looking for. :)

Related

Form reset for all fields except one Vue.js

I'm trying to find a way to to exclude one field input in my form that is disabled and contains the value of a users ID number
I would like to know how I can tweak this.$refs.form.reset(); because it works perfectly but it clears EVERYTHING and I wish to contain the ID value and resets the rest of the fields like name surname age income etc
The reason why I the ID is important is that the user gives this in a sign-up step at the start and this form that I am talking about is located somewhere else to complete his profile I don't want to ask the user again to type his ID in again.
If anyone knows how to accomplish this it would be a great help
The reset method of the form simply looks at all the inputs bound to it and resets each one within a loop then empties the error bag, observe:
reset (): void {
this.inputs.forEach(input => input.reset())
this.resetErrorBag()
},
There's no reason you can't do the same, except for when they're disabled:
resetForm() {
this.$refs.form.inputs.forEach(input => {
if (!input.disabled) {
input.reset()
}
})
this.$refs.form.resetErrorBag() // necessary to remove validation errors after the field values are removed
}
Then you can call that function (against your Vue instance, not your VForm) with this.resetForm() and it should work out the way you want.
Disclaimer: Can't test it at the moment. input.disabled may not be readily available and may require further inspection of the input element.

How to access value from react-native-cn-richtext-editor

I have successfully implemented react-native-cn-richtext-editor with limited toolbar functions.
I want to know that, how to get value (text that we have typed) from editor.
I am new in RN, have tried to get value but didn't get success. How can I resolve this issue, as I want to sent this text to server and then do further process.
In given example of this library there is method onValueChange on change the content object is present in value and to extract the value below example is there
onValueChanged = (value) => {
console.log(value[0].content[0].text)
}
Finally I got the solution of above question.
convert the value in HTML with convertToHtmlString write following command,
let html = convertToHtmlString(this.state.value)
for more details refer this github link

Store as Json Blob or Make Columns?

I am building a "filter component" that displays all available filters for that "product type".
Pretty standard pretty much just think of bestbuy, amazon, craiglist style filter.
Right now I am focusing on how to generate the filter options(not how to handle once a user clicks on a filter option and it must then go off and filter the results down).
So I created a json object that has something like this,
which will create each header section(HardDrive,Ram Size, Number of CPU Cores), what type is it(checkboxes, textboxes),
should the section be opened,
should it have a search box in it.
{
type: "", // this is what type of filter it will be (textbox, checkboxes and etc)
header: "Filter Header",
property: "", // this maps it back to the column name in db used when filter is actually triggered.
hasSearchBox: false, // some filter options are long so search box can be shown.
isOpen: true, // controls if this filter should be in an open or closed state.
for: ["What Products this filter applies to. Some of these filters are common between all products"]
},
Now I need to figure out if I should store the above as is or if I should break it into a column format.
Ie
Filters Tbl
Id
ProductTypeId
type
header
property
hasSearchBox
isOpen
This does make it easier to add a new filter in the future, but I am bit concerned if some new option comes in that might only be for some filters and not others(ie lots of null columns) or if I need a more complex objects in the future(like setting the placeholder name for the textbox).
or if I should store it like this
ProductTypeTable
Id
FilterOptions <--- json from above gets store in here.

v-select : cant show the seleted element

Im using Vuetify in my project. When I insert some data by v-select its working fine. Also when Im edit that data that also works. The only problem is I cant see the selected element when Im click on Edit.
Here is my code
<v-select
prepend-icon="star_rate"
:items="ratings"
v-model="customer.rating"
label="Rating"
item-text="text"
item-value="customer.rating"
single-line
></v-select>
Note: If I use {{customer.rating}} it gives an output like this
{ "id": 1, "text": "Bad" }
and If I select a different element its perfectly change on database. So everything is fine. The only requirement is I want show this value Bad as a selected element when I click on Edit.
Here is the complete code of my project file https://github.com/Shakilzaman87/pukucrm/blob/master/src/components/customers/EditCustomer.vue
Thanks in advance
It's and old question but Let me post my answer to help others as well, after alot of search I have come to this point, and I want to share it with others as well.
//This will load all your ratings in dropdown
<v-select
v-model="customer.ratings"
:items="ratings"
item-text="text"
item-value="id"
label="Rating"
dense>
</v-select>
Now Edit Part
Lets say you want to edit a record, so you will probably pass the record id in edit method of your vuejs then inside edit method of vuejs, you will do an edit axios call for that specific record to first show it inside fields and then you will update. But before update you need to do something inside edit method of your vuejs when you will have already loaded data for that specific id.
Now lets say you have received a record from database according to a specific id, you will see a dropdown id I mean to say a foreign key for a dropdown that you had saved during storing data.
Suppose you have ratings array which holds whole data for a dropdown. Inside this you are having an id and text fields. So you have this ratings array and an object from database during edit for a specific record. Now you are good to go with below code.
Inside Edit Method of vuejs
this.customer.ratings = this.ratings.find(item => item.id === parseInt(res.data.rating_id))
this.customer.ratings = parseInt(this.customer.ratings.rating_id)
Note: I am doing parseInt() it's because when you check in console the primary key is an integer like 1 but foreign key like rating_id is string i-e "1". You can also use two equals == if you are not using parseInt() but I haven't checked that.
For clearly understanding I am just sharing a sample edit code which might help you a bit
editItem(id){
axios.get( `/api/category/${id}` ).then( res => {
if(res.data.status === 200){
console.log(res.data.data)
this.name = res.data.data.name
this.id = res.data.data.id
this.parent_id = this.list_categories.find(item => item.id === parseInt(res.data.data.parent_id))
this.parent_id = parseInt(this.parent_id.id)
this.edited = true
}else{
this.$toaster.error( res.data.message )
}
});
}
I'm not sure what you mean by "... when Im click on Edit." but I will presume you mean when you click on the dropdown menu.
From what you have provided in your jsfiddle, your v-select should be like this:
<v-select
prepend-icon="star_rate"
:items="ratings"
v-model="customer.rating"
label="Rating"
item-text="ratings.text"
item-value="ratings"
single-line
></v-select>
This can be found here, in the API props section.
item-text: Set property of items’s text value
item-value: Set property of items’s value
The text is what you see, I believe that text which is the current value of item-text is either undefined or not declared. If this answer doesn't work, then you need to provide more of your code.

How to get select box options from GetCustomFields() method of jira

I was curious if anyone else had an idea how to get a select box options of the custom field in JIRA using soap api, if you have have custom field id.
You can reference select list values by their id. To get id go to Custom Field configuration -> Edit Options. Hover over the option's 'Edit' operation (or click on Edit) and check link address. It will be something like 'secure/admin/EditCustomFieldOptions!edit.jspa?fieldConfigId=10480&selectedValue=10030'
selectedValue is the id of select list option.